fix: CheckPushPermissions not being called when CacheRepo was set (#1471)
This commit is contained in:
parent
5afb142c69
commit
2f8d939b3f
|
|
@ -95,7 +95,7 @@ var RootCmd = &cobra.Command{
|
||||||
}
|
}
|
||||||
logrus.Warn("kaniko is being run outside of a container. This can have dangerous effects on your system")
|
logrus.Warn("kaniko is being run outside of a container. This can have dangerous effects on your system")
|
||||||
}
|
}
|
||||||
if !opts.NoPush {
|
if !opts.NoPush || opts.CacheRepo != "" {
|
||||||
if err := executor.CheckPushPermissions(opts); err != nil {
|
if err := executor.CheckPushPermissions(opts); err != nil {
|
||||||
exit(errors.Wrap(err, "error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again"))
|
exit(errors.Wrap(err, "error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again"))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ var (
|
||||||
// CheckPushPermissions checks that the configured credentials can be used to
|
// CheckPushPermissions checks that the configured credentials can be used to
|
||||||
// push to every specified destination.
|
// push to every specified destination.
|
||||||
func CheckPushPermissions(opts *config.KanikoOptions) error {
|
func CheckPushPermissions(opts *config.KanikoOptions) error {
|
||||||
var targets = opts.Destinations
|
targets := opts.Destinations
|
||||||
// When no push is set, whe want to check permissions for the cache repo
|
// When no push is set, whe want to check permissions for the cache repo
|
||||||
// instead of the destinations
|
// instead of the destinations
|
||||||
if opts.NoPush {
|
if opts.NoPush {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue