-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Allow artifact add to override org.opencontainers.image.title annotation #27238
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
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rhatdan The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@Luap99 PTAL |
An issue this introduces is when using So So we need to do something like block setting the org.opencontainers.image.title if multiple artifacts are being added in one call or maybe better yet fail if the artifact already has file/blob with the same @baude WDYT [1] https://docs.podman.io/en/v5.6.2/markdown/podman-artifact-add.1.html#annotation-annotation-value |
The same issue exists if you do the same name multiple times. ./bin/podman artifact add --annotation=org.opencontainers.image.title=testname multitest README.md So we can either check to see if the annotation is already defined, or just leave it to the users to deal with it. IE this is legal theoretically in the spec, so if users add it then they have to deal with it when the attempt to mount the object. |
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.
looks reasonable, as we discussed in the community meeting we should generate an error if the same name is set for more than one file.
test/e2e/artifact_test.go
Outdated
title := RandomString(12) | ||
annotation3 := fmt.Sprintf("org.opencontainers.image.title=%s", title) | ||
podmanTest.PodmanExitCleanly("artifact", "add", "--annotation", annotation3, "foobar", artifact1File) | ||
Expect(a.Manifest.Layers[0].Annotations["org.opencontainers.image.title"]).To(Equal(title)) |
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.
that is not checking the right thing, you need to inspect the artifact you just created with podmanTest.InspectArtifact("foobar") and use that return value to check the annotation
Signed-off-by: Daniel J Walsh <[email protected]>
Does this PR introduce a user-facing change?