mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 06:26:59 +02:00
Use correct media type for zstd layers (#2459)
In my previous commits I forgot to override the media type for layers that are using zstd compression.
This commit is contained in:
@@ -31,6 +31,7 @@ import (
|
||||
"github.com/google/go-containerregistry/pkg/v1/empty"
|
||||
"github.com/google/go-containerregistry/pkg/v1/mutate"
|
||||
"github.com/google/go-containerregistry/pkg/v1/tarball"
|
||||
"github.com/google/go-containerregistry/pkg/v1/types"
|
||||
"github.com/moby/buildkit/frontend/dockerfile/instructions"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -527,7 +528,7 @@ func (s *stageBuilder) saveSnapshotToLayer(tarPath string) (v1.Layer, error) {
|
||||
|
||||
switch s.opts.Compression {
|
||||
case config.ZStd:
|
||||
layerOpts = append(layerOpts, tarball.WithCompression("zstd"))
|
||||
layerOpts = append(layerOpts, tarball.WithCompression("zstd"), tarball.WithMediaType(types.OCILayerZStd))
|
||||
|
||||
case config.GZip:
|
||||
// layer already gzipped by default
|
||||
|
||||
@@ -41,6 +41,7 @@ import (
|
||||
"github.com/google/go-containerregistry/pkg/v1/remote"
|
||||
"github.com/google/go-containerregistry/pkg/v1/remote/transport"
|
||||
"github.com/google/go-containerregistry/pkg/v1/tarball"
|
||||
"github.com/google/go-containerregistry/pkg/v1/types"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/afero"
|
||||
@@ -307,7 +308,7 @@ func pushLayerToCache(opts *config.KanikoOptions, cacheKey string, tarPath strin
|
||||
|
||||
switch opts.Compression {
|
||||
case config.ZStd:
|
||||
layerOpts = append(layerOpts, tarball.WithCompression("zstd"))
|
||||
layerOpts = append(layerOpts, tarball.WithCompression("zstd"), tarball.WithMediaType(types.OCILayerZStd))
|
||||
|
||||
case config.GZip:
|
||||
// layer already gzipped by default
|
||||
|
||||
Reference in New Issue
Block a user