Merge pull request #370 from vbehar/cleanup-flag

Add a new flag to cleanup the filesystem at the end
This commit is contained in:
priyawadhwa
2018-09-28 10:27:29 -07:00
committed by GitHub
4 changed files with 11 additions and 0 deletions
+1
View File
@@ -33,4 +33,5 @@ type KanikoOptions struct {
Reproducible bool
NoPush bool
Cache bool
Cleanup bool
}
+5
View File
@@ -264,6 +264,11 @@ func DoBuild(opts *config.KanikoOptions) (v1.Image, error) {
return nil, err
}
}
if opts.Cleanup {
if err = util.DeleteFilesystem(); err != nil {
return nil, err
}
}
return sourceImage, nil
}
if stage.SaveStage {