mz523: skip interstage clean#524
Conversation
f13accc to
b3d6383
Compare
b3d6383 to
a3bb33f
Compare
|
for now we should not yet skip saving the stages as in 3f85e78 if i > 0 && kanikoStages[i].BaseImageIndex == kanikoStages[i-1].Index {
+ kanikoStages[i-1].SaveStage = stagesDependencies[kanikoStages[i-1].Index] > 1
kanikoStages[i-1].Clean = false
kanikoStages[i].Unpack = false
}The reason is that it breaks in which then breaks as the sourceImage was never saved in the first place. We faced the same issue in multi-stage cache lookahead, although for a different reason. There we opted to keep the images in memory instead of the filesystem. For now, let's not take this second minor optimization and come back to it once we have cache lookahead merged. Then on the other hand that would be a good way to get part of the change split out of cache lookahead, so it is less daunting for review. Maybe a part 2 to this change. |
|
nice! the integration tests caught another very complex issue Each stage can decide whether we need to unpack or not. But now with this logic we rely on the previous stage having unpacked the filesystem for us so we can skip doing that. Of course that can't work if the previous stage can decide that independently. After multistage cache lookahead this would actually also be pretty easy to implement, as then we can check whether unpack will be required a-priori. |
|
so let's just defer his change after #299 |
Fixes #523
Description
In multi-stage builds, kaniko always tears down the filesystem and re-unpacks the base image between stages. When a stage's
FROMresolves to the immediately preceding preceding stage, this round-trip is redundant. With this change we introduceFF_KANIKO_SKIP_INTERSTAGE_CLEANUPthat allows users to optionally skip redundant inter-stage cleanups.