-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Check push permissions before building images #622
Conversation
cmd/executor/cmd/root.go
Outdated
@@ -79,6 +78,9 @@ var RootCmd = &cobra.Command{ | |||
} | |||
logrus.Warn("kaniko is being run outside of a container. This can have dangerous effects on your system") | |||
} | |||
if err := executor.CheckPushPermissions(opts); err != nil { | |||
exit(errors.Wrap(err, "error checking push permissions")) |
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 main use case here is to fail early because of a typo right? Maybe a more user-friendly error message would be useful here in this case.
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's possible it's a typo, but it could also be the wrong account logged in at the time. I'm not sure I could detect the error messages for one or the other well enough to give a better message.
Unless you mean something like error checking permissions -- check for typos and try again
?
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.
Yeah, just adding something like: "make sure you entered the right repository %s and that you are authenticated correctly and try again"
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.
Done:
error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again: checking push permission for "gcr.io/g0000000000gle/foo:latest": UNKNOWN: Project 'projects/g0000000000gle' not found or deleted.
This breaks pushing to remote registries which are http based. |
@iciclespider Agreed it does appear to be breaking pushing to remote registries that are HTTP based; I am getting the following error: |
This calls
remote.CheckPushPermission
for each unique repository in--destination
flags, and fails if the current keychain doesn't have push permissions to any repository.Tested locally: