mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 06:50:21 +02:00
feat: kaniko dir config option (#1997)
* remove configurables from constants * add configurables to config init * add kaniko dir flag * cleanup pkg constants * replace buildcontext constants pkg occurrences with config * add KanikoDir to KanikoOptions * replace executor constants pkg occurrences with config * remove redundant KanikoDir assignment * replace constants to config for IntermediateStagesDir * fix imports * add default kaniko directory into constants * add check for kanikoDir on use * update init to use default path constant * update executor kanikoDir check Co-authored-by: Jason Hall <jasonhall@redhat.com> * alter checkKanikoDir parameter * add TestKanikoDir func * update error handling style Co-authored-by: Jason Hall <jasonhall@redhat.com> * remove shorthand flag usage from test Co-authored-by: Jason Hall <jasonhall@redhat.com> * add docstring to integration test Co-authored-by: Jason Hall <jasonhall@redhat.com> * remove shorthand flag from kaniko-dir Co-authored-by: Jason Hall <jasonhall@redhat.com>
This commit is contained in:
@@ -829,7 +829,7 @@ func saveStageAsTarball(path string, image v1.Image) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tarPath := filepath.Join(constants.KanikoIntermediateStagesDir, path)
|
||||
tarPath := filepath.Join(config.KanikoIntermediateStagesDir, path)
|
||||
logrus.Infof("Storing source image from stage %s at path %s", path, tarPath)
|
||||
if err := os.MkdirAll(filepath.Dir(tarPath), 0750); err != nil {
|
||||
return err
|
||||
|
||||
@@ -177,7 +177,6 @@ func setupMultistageTests(t *testing.T) (string, func()) {
|
||||
}
|
||||
config.IgnoreListPath = mFile
|
||||
return testDir, func() {
|
||||
config.KanikoDir = constants.KanikoDir
|
||||
config.RootDir = constants.RootDir
|
||||
config.IgnoreListPath = constants.IgnoreListPath
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user