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:
dlorenc
2019-01-30 13:57:02 -06:00
committed by GitHub
parent 63547d700c
commit c2514305ef
3 changed files with 9 additions and 9 deletions
-5
View File
@@ -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
+1 -1
View File
@@ -147,7 +147,7 @@ func Test_stageBuilder_shouldTakeSnapshot(t *testing.T) {
args: args{
index: 0,
},
want: false,
want: true,
},
{
name: "caching enabled intermediate container",