Check push permissions before building images#622
Check push permissions before building images#622dlorenc merged 3 commits intoGoogleContainerTools:masterfrom
Conversation
| 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.
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.
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.
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.
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.CheckPushPermissionfor each unique repository in--destinationflags, and fails if the current keychain doesn't have push permissions to any repository.Tested locally: