@@ -456,17 +456,18 @@ func Run(ctx context.Context, opts options.Options) error {
456456 }
457457 kOpts := & config.KanikoOptions {
458458 // Boilerplate!
459- CustomPlatform : platforms .Format (platforms .Normalize (platforms .DefaultSpec ())),
460- SnapshotMode : "redo" ,
461- RunV2 : true ,
462- RunStdout : stdoutWriter ,
463- RunStderr : stderrWriter ,
464- Destinations : destinations ,
465- NoPush : ! opts .PushImage || len (destinations ) == 0 ,
466- CacheRunLayers : true ,
467- CacheCopyLayers : true ,
468- CompressedCaching : true ,
469- Compression : config .ZStd ,
459+ CustomPlatform : platforms .Format (platforms .Normalize (platforms .DefaultSpec ())),
460+ SnapshotMode : "redo" ,
461+ RunV2 : true ,
462+ RunStdout : stdoutWriter ,
463+ RunStderr : stderrWriter ,
464+ Destinations : destinations ,
465+ NoPush : ! opts .PushImage || len (destinations ) == 0 ,
466+ CacheRunLayers : true ,
467+ CacheCopyLayers : true ,
468+ ForceBuildMetadata : opts .PushImage , // Force layers with no changes to be cached, required for cache probing.
469+ CompressedCaching : true ,
470+ Compression : config .ZStd ,
470471 // Maps to "default" level, ~100-300 MB/sec according to
471472 // benchmarks in klauspost/compress README
472473 // https://github.com/klauspost/compress/blob/67a538e2b4df11f8ec7139388838a13bce84b5d5/zstd/encoder_options.go#L188
@@ -1180,17 +1181,18 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error)
11801181 }
11811182 kOpts := & config.KanikoOptions {
11821183 // Boilerplate!
1183- CustomPlatform : platforms .Format (platforms .Normalize (platforms .DefaultSpec ())),
1184- SnapshotMode : "redo" ,
1185- RunV2 : true ,
1186- RunStdout : stdoutWriter ,
1187- RunStderr : stderrWriter ,
1188- Destinations : destinations ,
1189- NoPush : ! opts .PushImage || len (destinations ) == 0 ,
1190- CacheRunLayers : true ,
1191- CacheCopyLayers : true ,
1192- CompressedCaching : true ,
1193- Compression : config .ZStd ,
1184+ CustomPlatform : platforms .Format (platforms .Normalize (platforms .DefaultSpec ())),
1185+ SnapshotMode : "redo" ,
1186+ RunV2 : true ,
1187+ RunStdout : stdoutWriter ,
1188+ RunStderr : stderrWriter ,
1189+ Destinations : destinations ,
1190+ NoPush : true ,
1191+ CacheRunLayers : true ,
1192+ CacheCopyLayers : true ,
1193+ ForceBuildMetadata : true , // Force layers with no changes to be cached, required for cache probing.
1194+ CompressedCaching : true ,
1195+ Compression : config .ZStd ,
11941196 // Maps to "default" level, ~100-300 MB/sec according to
11951197 // benchmarks in klauspost/compress README
11961198 // https://github.com/klauspost/compress/blob/67a538e2b4df11f8ec7139388838a13bce84b5d5/zstd/encoder_options.go#L188
0 commit comments