add caching copy layers back (#1518)

* add caching copy layers back

* fix test

* lint

* fix test - 2

* Add integration test

* fix lint
This commit is contained in:
Tejal Desai
2020-12-11 00:25:03 -08:00
committed by GitHub
parent dde98a8e73
commit b04399eeac
11 changed files with 405 additions and 16 deletions
+2 -1
View File
@@ -127,7 +127,7 @@ func newStageBuilder(opts *config.KanikoOptions, stage config.KanikoStage, cross
}
for _, cmd := range s.stage.Commands {
command, err := commands.GetCommand(cmd, fileContext, opts.RunV2)
command, err := commands.GetCommand(cmd, fileContext, opts.RunV2, opts.CacheCopyLayers)
if err != nil {
return nil, err
}
@@ -184,6 +184,7 @@ func (s *stageBuilder) populateCompositeKey(command fmt.Stringer, files []string
compositeKey.AddKey(resolvedCmd)
switch v := command.(type) {
case *commands.CopyCommand:
case *commands.CachingCopyCommand:
compositeKey = s.populateCopyCmdCompositeKey(command, v.From(), compositeKey)
}