-
Notifications
You must be signed in to change notification settings - Fork 379
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
Add image.UnparsedInstanceWithReference and storage.ResolveReference #2056
Conversation
102ff82
to
d61e9cd
Compare
fdae822
to
31f3c28
Compare
7dae432
to
ca4e107
Compare
Also adding ref := ParseReference(userInput)
ref2, img := ResolveReference(ref)
src := ref2.NewImageSource while ensuring that img and src are guaranteed to refer to the same image. @vrothberg PTAL;
|
This is useful for combining image data with other reference values, e.g. to check signatures on a locally-pulled image based on a remote-registry policy. This was historically possible to do by simply providing an external UnparsedInstance implementation; now that we have sigstore signatures which can't be represent that way, and a private.UnparsedImage, external users are not allowed to directly access/implement private.UnparsedImage, so this needs to be an explicitly-provided operation. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
See the added comments for details. This allows things like > ref := ParseReference(userInput) > ref2, img := ResolveReference(ref) > src := ref2.NewImageSource while ensuring that img and src are _guaranteed_ to refer to the same image. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
ca4e107
to
6cb88ae
Compare
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.
Thank you!
This is now ready for review/merging. cri-o/cri-o#7435 is a proof-of-concept of the |
LGTM |
... and add some temporary //nolint comments for newly-deprecated functions. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
... and add some temporary //nolint comments for newly-deprecated functions. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
GetStoreImage is deprecated after containers/image#2056 Signed-off-by: Aditya R <arajan@redhat.com>
With deprecation of these API CI is forcing podman and buildah to use For buildah side (containers/buildah#5129) I have edited changed the code but I wonder if this is a breaking change ? |
@mtrmac ^ Is this something which is breaking change ? or am I just overthinking here. |
Oh, yes, I forgot to document that here. It’s not a breaking change because |
Alternatively, we could change the error type back… but on balance, I think returning a |
#2170 should help with the documentation, and/or change the returned error types. |
... to include containers/image#2056 . Also add some temporary //nolint comments for newly-deprecated functions. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
We need to implement this locally, instead of having external callers do it, because external wrapping would make the sigstore-relevant
UntrustedSignatures
unavailable.See conversation in cri-o/cri-o#7046 .