Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid pushing artifacts without artifactType if --image-spec v1.1 is specified #1313

Closed
1 task
qweeah opened this issue Mar 28, 2024 · 2 comments · Fixed by #1317
Closed
1 task

avoid pushing artifacts without artifactType if --image-spec v1.1 is specified #1313

qweeah opened this issue Mar 28, 2024 · 2 comments · Fixed by #1317
Assignees
Labels
bug Something isn't working
Milestone

Comments

@qweeah
Copy link
Contributor

qweeah commented Mar 28, 2024

What is the version of your ORAS CLI

v1.2.0

What would you like to be added?

oras push supports pushing an artifact without artifactType even when OCI image spec v1.1 is specified.

~ oras push localhost:5000/artifact:type --format json --config <(echo -n "{}"):my/type --image-spec v1.1
✓ Exists    my/type                                                                                0/0  B 100.00%     0s
  └─ sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
✓ Exists    application/vnd.oci.empty.v1+json                                                      2/2  B 100.00%     0s
  └─ sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
✓ Uploaded  application/vnd.oci.image.manifest.v1+json                                         442/442  B 100.00%     0s
  └─ sha256:3179007d443a6c79a5e3b8af868cf762202ca3e95ecf87da456e59963913e006
{
  "Ref": "localhost:5000/artifact@sha256:3179007d443a6c79a5e3b8af868cf762202ca3e95ecf87da456e59963913e006",
  "MediaType": "application/vnd.oci.image.manifest.v1+json",
  "Digest": "sha256:3179007d443a6c79a5e3b8af868cf762202ca3e95ecf87da456e59963913e006",
  "Size": 442,
  "Annotations": {
    "org.opencontainers.image.created": "2024-03-28T01:43:28Z"
  },
  "ArtifactType": ""
}~ oras manifest fetch --pretty localhost:5000/artifact:type
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "config": {
    "mediaType": "my/type",
    "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
    "size": 0
  },
  "layers": [
    {
      "mediaType": "application/vnd.oci.empty.v1+json",
      "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
      "size": 2,
      "data": "e30="
    }
  ],
  "annotations": {
    "org.opencontainers.image.created": "2024-03-28T01:43:28Z"

Why is this needed for ORAS?

According to the guidance, v1.1 artifact should always contains an artifactType, so

  1. --config MUST not to be used with --image-spec v1.1 if --artifac-type is not specified, return error when encounter this.
  2. --image-spec should be default to auto, which represents v1.0 if --config is used and --artifact-type not used. Otherwise v1.1

Are you willing to submit PRs to contribute to this feature?

  • Yes, I am willing to implement it.
@qweeah qweeah added enhancement New feature or request triage New issues or PRs to be acknowledged by maintainers bug Something isn't working and removed enhancement New feature or request labels Mar 28, 2024
@qweeah qweeah added this to the v1.2.0 milestone Mar 28, 2024
@wangxiaoxuan273
Copy link
Contributor

I'd like to work on this issue

@qweeah qweeah removed the triage New issues or PRs to be acknowledged by maintainers label Apr 2, 2024
@qweeah
Copy link
Contributor Author

qweeah commented Apr 8, 2024

--image-spec should be default to auto, which represents v1.0 if --config is used and --artifact-type not used. Otherwise v1.1

This is to make oras push --config xxx workable to avoid breaking change. Adding #1327 to remove this workaround in v2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants