mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-09-30 19:31:57 +02:00
Check push permissions before building images (#622)
* Check push permissions before building images * Fix doc comment * improve error messages
This commit is contained in:
@@ -24,12 +24,11 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/GoogleContainerTools/kaniko/pkg/timing"
|
||||
|
||||
"github.com/GoogleContainerTools/kaniko/pkg/buildcontext"
|
||||
"github.com/GoogleContainerTools/kaniko/pkg/config"
|
||||
"github.com/GoogleContainerTools/kaniko/pkg/constants"
|
||||
"github.com/GoogleContainerTools/kaniko/pkg/executor"
|
||||
"github.com/GoogleContainerTools/kaniko/pkg/timing"
|
||||
"github.com/GoogleContainerTools/kaniko/pkg/util"
|
||||
"github.com/genuinetools/amicontained/container"
|
||||
"github.com/pkg/errors"
|
||||
@@ -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 -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again"))
|
||||
}
|
||||
if err := os.Chdir("/"); err != nil {
|
||||
exit(errors.Wrap(err, "error changing to root dir"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user