mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 17:54:15 +02:00
Fix a bug in snapshotting with multi-stage images. (#546)
We previously had an optimization that would skip snapshotting mutli-stage images when in an intermediate stage, until the very end. This conflicted with another optimization to avoid snapshotting when no files had changed.
This commit is contained in:
@@ -309,11 +309,6 @@ func (s *stageBuilder) shouldTakeSnapshot(index int, files []string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// We only snapshot the very end of intermediate stages.
|
||||
if !s.stage.Final {
|
||||
return isLastCommand
|
||||
}
|
||||
|
||||
// nil means snapshot everything.
|
||||
if files == nil {
|
||||
return true
|
||||
|
||||
@@ -147,7 +147,7 @@ func Test_stageBuilder_shouldTakeSnapshot(t *testing.T) {
|
||||
args: args{
|
||||
index: 0,
|
||||
},
|
||||
want: false,
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
name: "caching enabled intermediate container",
|
||||
|
||||
Reference in New Issue
Block a user