-
Notifications
You must be signed in to change notification settings - Fork 185
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
oci/build: Specify ArtifactType in the correct place #2572
Conversation
As discussed in #2177, the ArtifactType must be specified when config.mediaType is set MediaTypeEmptyJSON. In our case, when the metadata file is not provided. However, such PR added the ArtifactType inside the config and not to the general manifest as described in [1]. Fixes: 1b04865 [1] https://github.com/opencontainers/image-spec/blob/f5f87016de46439ccf91b5381cf76faaae2bc28f/manifest.md?plain=1#L210 Signed-off-by: Jose Blanquicet <josebl@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great Catch! Out of curiosity how did you catch this? Perhaps we can consider to create tests for our manifest validation in future.
Tested with steps mentioned in #2177 and no problems in pushing the image as well.
Does it solve #2289? |
While reviewing #2512 (comment), I noticed it was looking at the
Agree! #2577
Thanks! |
Things looking better now:
|
Yep. It does! I test it with trace_open in my ACR registry: jose trace_open git:(main *)$ ls
program.bpf.c Before this PRjose trace_open git:(main *)$ IG_EXPERIMENTAL=true go run --exec "sudo -E" ../../cmd/ig/... image build -t joseregistry.azurecr.io/trace_open:latest .
INFO[0000] Experimental features enabled
Successfully built joseregistry.azurecr.io/trace_open:latest@sha256:4dd9d2a330a85d15eb69b75a261dda17045d5c3fb68287e16030ba429af779b6
jose trace_open git:(main *)$ IG_EXPERIMENTAL=true go run --exec "sudo -E" ../../cmd/ig/... image push joseregistry.azurecr.io/trace_open:latest
INFO[0000] Experimental features enabled
Pushing joseregistry.azurecr.io/trace_open:latest...
Error: pushing gadget: copying to remote repository: PUT "https://joseregistry.azurecr.io/v2/trace_open/manifests/sha256:5b0c1ddffd0b687226fc850a1a3b3d514310f4ebbc7e0d148e9ce35c4beeb831": response status code 400: manifest invalid: manifest invalid: map[Reason:using empty config descriptor requires artifactType to be defined]
exit status 1 After this PRjose trace_open git:(jose/empty-descriptor *)$ IG_EXPERIMENTAL=true go run --exec "sudo -E" ../../cmd/ig/... image build -t joseregistry.azurecr.io/trace_open:latest .
INFO[0000] Experimental features enabled
Successfully built
joseregistry.azurecr.io/trace_open:latest@sha256:b78f41657ea1e0492122fba1898728f19a2610cb7cff93b67009610ba41407ff
jose trace_open git:(jose/empty-descriptor *)$ IG_EXPERIMENTAL=true go run --exec "sudo -E" ../../cmd/ig/... image push joseregistry.azurecr.io/trace_open:latest
INFO[0000] Experimental features enabled
Pushing joseregistry.azurecr.io/trace_open:latest...
Successfully pushed joseregistry.azurecr.io/trace_open:latest@sha256:b78f41657ea1e0492122fba1898728f19a2610cb7cff93b67009610ba41407ff |
Specify ArtifactType in the correct place when building the image
As discussed in #2177, the ArtifactType must be specified when config.mediaType is set MediaTypeEmptyJSON. In our case, when the metadata file is not provided. However, such PR added the ArtifactType inside the config and not to the general manifest as described in [1].
Fixes: 1b04865
[1] https://github.com/opencontainers/image-spec/blob/f5f87016de46439ccf91b5381cf76faaae2bc28f/manifest.md?plain=1#L210
Before this PR
After this PR
The new result now looks like the example provided by image-spec: