diff --git a/cmd/executor/cmd/root.go b/cmd/executor/cmd/root.go index 7f0339c5df..32a47db51f 100644 --- a/cmd/executor/cmd/root.go +++ b/cmd/executor/cmd/root.go @@ -122,6 +122,8 @@ var RootCmd = &cobra.Command{ dir := config.KanikoDir if opts.KanikoDir != constants.DefaultKanikoPath { dir = opts.KanikoDir + //forcing the KANIKO_DIR to be the same as the flag in current process (all executeCommand()) + os.Setenv("KANIKO_DIR", opts.KanikoDir) } if err := checkKanikoDir(dir); err != nil {