GoogleContainerTools / kaniko

Build Container Images In Kubernetes
Apache License 2.0
14.69k stars 1.43k forks source link

compression=zstd not working starting from v1.16 #3147

Open routehero opened 5 months ago

routehero commented 5 months ago

Actual behavior gcr.io/kaniko-project/executor:v1.15.0-debug is able to produce layers compressed with zstd

gcr.io/kaniko-project/executor:v1.22.0-debug throws an error:

error building image: error building stage: failed to save snapshot to image: gzip: invalid compression level: 20

This error doesn't make sense if kaniko were using zstd. Removing --compression-level=20 from the args allows kaniko to succeed, but the layers are compressed with gzip.

Expected behavior When using --compression=zstd, the layers produced should be compressed with zstd.

To Reproduce Steps to reproduce the behavior:

  1. starting from v1.16.0 up to and including v1.22.0, use args: --compression=zstd --compression-level=20 --single-snapshot
  2. remove --compression-level=20, then run docker manifest inspect on the newly created image. you will only see gzip.

Additional Information