Skip to content

Commit

Permalink
Restore build args after optimize. Fixes GoogleContainerTools#1910, G…
Browse files Browse the repository at this point in the history
  • Loading branch information
apollo13 committed Feb 7, 2022
1 parent bde9043 commit 731068f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/executor/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ func (s *stageBuilder) optimize(compositeKey CompositeCache, cfg v1.Config) erro
if !s.opts.Cache {
return nil
}
var buildArgs = s.args.Clone()
// Restore build args back to their original values
defer func() {
s.args = buildArgs
}()

stopCache := false
// Possibly replace commands with their cached implementations.
Expand Down

0 comments on commit 731068f

Please sign in to comment.