-
Notifications
You must be signed in to change notification settings - Fork 46
Fix mediaType in config for track bundle #3092
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
base: main
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨No code suggestions found for the PR. |
|
Seems reasonable to me. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/ok-to-test |
User description
A command like
produces and OCI image with the following manifest:
{ "schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", "config": { "mediaType": "application/vnd.unknown.config.v1+json", "size": 467, "digest": "sha256:b1d034b3d9773504ede9ca5008933b290824fdf3ce2b52067f72f614fee8f517" }, "layers": [ { "mediaType": "application/vnd.cncf.openpolicyagent.data.layer.v1+json", "size": 397, "digest": "sha256:515c2845b43250e4b4eaea11d56a36cfae19db779030c5d8a040d21859a8f911", "annotations": { "org.opencontainers.image.title": "data/data/trusted_tekton_tasks.yml" } } ] }Note,
config.mediaTypeisapplication/vnd.unknown.config.v1+jsonwhich cause many tools (podman,docker,scopeo, etc.) to refuse to work with such a bundle, e.g.With the fix applied:
and the manifest is the following:
{ "schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", "config": { "mediaType": "application/vnd.oci.image.config.v1+json", "size": 487, "digest": "sha256:86ecabfecfb19ef534a32f7591ead91f1659fce2772b5a1d28c2fbee6bf5892b" }, "layers": [ { "mediaType": "application/vnd.cncf.openpolicyagent.data.layer.v1+json", "size": 149, "digest": "sha256:dac62e1353dc29da1111368f28b0f3cbcffd945b1eb7a6b8b8be1969d56a54c3", "annotations": { "org.opencontainers.image.title": "data/data/trusted_tekton_tasks.yml" } } ] }PR Type
Bug fix
Description
Replace incorrect
application/vnd.unknown.config.v1+jsonwith standard OCI config mediaTypeUse
types.OCIConfigJSONconstant for proper OCI image compatibilityFix affects track bundle creation in both main code and tests
Diagram Walkthrough
File Walkthrough
image.go
Replace unknown config mediaType with OCI standardacceptance/image/image.go
unknownConfigconstant definitioncreateAndPushPolicyBundleto usetypes.OCIConfigJSONinsteadof
unknownConfigoci.go
Replace unknown config mediaType with OCI standardinternal/tracker/oci.go
unknownConfigconstant definitionPushImagefunction to usetypes.OCIConfigJSONinstead ofunknownConfigoci_test.go
Update test to use correct OCI config mediaTypeinternal/tracker/oci_test.go
TestPullImagetest to usetypes.OCIConfigJSONinstead ofunknownConfig