mirror of
https://github.com/moby/buildkit.git
synced 2025-07-27 16:41:49 +03:00
compression: introduce compression.Type interface
Introduce a new compression.Type interface, which needs to be implemented for each compression type, by that we can reduce the number of switch case statements and ensure that we don't miss the handle of any compression types, and also make more easily for supporting new compression types. This is a commit for code improvement, so no logical changes. Signed-off-by: Yan Song <imeoer@linux.alibaba.com>
This commit is contained in:
3
cache/blobs_nolinux.go
vendored
3
cache/blobs_nolinux.go
vendored
@ -6,11 +6,12 @@ package cache
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/moby/buildkit/util/compression"
|
||||
"github.com/containerd/containerd/mount"
|
||||
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (sr *immutableRef) tryComputeOverlayBlob(ctx context.Context, lower, upper []mount.Mount, mediaType string, ref string, compressorFunc compressor) (_ ocispecs.Descriptor, ok bool, err error) {
|
||||
func (sr *immutableRef) tryComputeOverlayBlob(ctx context.Context, lower, upper []mount.Mount, mediaType string, ref string, compressorFunc compression.Compressor) (_ ocispecs.Descriptor, ok bool, err error) {
|
||||
return ocispecs.Descriptor{}, true, errors.Errorf("overlayfs-based diff computing is unsupported")
|
||||
}
|
||||
|
Reference in New Issue
Block a user