-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix checkPushPermissions by --insecure #737
Conversation
Hey @cn-sunletian , looks like a linter error on travis:
|
ok i fixed it |
pkg/executor/push.go
Outdated
@@ -58,6 +58,13 @@ func CheckPushPermissions(opts *config.KanikoOptions) error { | |||
checked := map[string]bool{} | |||
for _, destination := range opts.Destinations { | |||
destRef, err := name.NewTag(destination, name.WeakValidation) | |||
if opts.Insecure { | |||
newReg, err := name.NewRegistry(destRef.RegistryStr(), name.WeakValidation) |
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 you want to pass in the insecure option to name.NewRegistry
-- found here in the go-containerregistry code
Looks like the integration test is failing due to
|
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.
New to this (sorry if I'm doing it wrong) but I was looking at this last night and found that NewTag takes options and creates the registry based on these. What's the benefit of overwriting the registry with a new insecure registry rather than passing name.Insecure to NewTag()?
Thanks
As @Dina0312 mentioned: Wouldn't something like this do the same thing, be cleaner and less code?
|
ok,thanks |
@@ -69,6 +69,13 @@ func CheckPushPermissions(opts *config.KanikoOptions) error { | |||
checked := map[string]bool{} | |||
for _, destination := range opts.Destinations { | |||
destRef, err := name.NewTag(destination, name.WeakValidation) | |||
if opts.Insecure || opts.InsecureRegistries.Contains(destination) { |
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.
shd this be &&
instead of ||
Hey @cn-sunletian, we merged #685 a few weeks ago which should fix this issue. Could you try with |
Closing this since #685 addresses this issue. |
@priyawadhwa , i have tried using gcr.io/kaniko-project/executor:v0.13.0 but no luck. is there any way |
@priyawadhwa where does cluster builder get the docker repository url. I am getting http instead of https causing the error . |
Hey @pvgbabu sorry to hear that. Could you open a new issue with the error you're getting? |
Our registry is harbor by http. When I push image, error occurred on function CheckPushPermissions.
Even add "--insecure" that doesn't work, but add "--insecure-pull" it can pull well.So i find "push.go" an error here. have look at #683