@@ -456,17 +456,18 @@ func Run(ctx context.Context, opts options.Options) error {
456
456
}
457
457
kOpts := & config.KanikoOptions {
458
458
// 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 ,
470
471
// Maps to "default" level, ~100-300 MB/sec according to
471
472
// benchmarks in klauspost/compress README
472
473
// 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)
1180
1181
}
1181
1182
kOpts := & config.KanikoOptions {
1182
1183
// 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 ,
1194
1196
// Maps to "default" level, ~100-300 MB/sec according to
1195
1197
// benchmarks in klauspost/compress README
1196
1198
// https://github.com/klauspost/compress/blob/67a538e2b4df11f8ec7139388838a13bce84b5d5/zstd/encoder_options.go#L188
0 commit comments