-
Notifications
You must be signed in to change notification settings - Fork 547
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 -allow-insecure-registry
flag to permit unsecured container registries
#669
Conversation
7546334
to
b2e7cb4
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.
lgtm! you could write a quick test by starting an insecure registry in docker, pushing an image, signing & verifying it (that's basically why we needed this in chains)
dd5395d
to
91efa15
Compare
|
ref, err := name.ParseReference(imageRef) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
get, err := remote.Get(ref, remote.WithAuthFromKeychain(authn.DefaultKeychain)) | ||
get, err := remote.Get(ref, regOpts.GetRegistryClientOpts(ctx)...) |
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.
Is dropping the LHS intentional, since IIRC it's the default behavior?
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.
?
The effect of the change on this line specifically should be to a) propagate ctx, b) allow for broken TLS when the flag is set
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.
I think what confused me was that the LHS wasn't using DefaultRegistryClientOpts
and the implementation of this function delegates to that which hides the fact that it is a superset. I left a comment on that below, let's kill DefaultRegistryClientOpts
completely if we can.
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.
roger
cmd/cosign/cli/flags.go
Outdated
} | ||
|
||
func (co *RegistryOpts) GetRegistryClientOpts(ctx context.Context) []remote.Option { | ||
opts := DefaultRegistryClientOpts(ctx) |
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.
I wonder whether it's worth getting rid of this helper? Just inline it so that folks use the appropriate new one?
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.
It would gently nudge people in the right direction...
53627ad
to
0ad6694
Compare
…istries Signed-off-by: Jake Sanders <jsand@google.com>
0ad6694
to
f8e298a
Compare
Fixes #311