|
| 1 | +From b11c8fadd114d1c75480fcfb600587351e1789bc Mon Sep 17 00:00:00 2001 |
| 2 | +From: Mitch Zhu <mitchzhu@microsoft.com> |
| 3 | +Date: Tue, 27 May 2025 21:19:31 +0000 |
| 4 | +Subject: [PATCH] tardev-snapshotter support patch |
| 5 | + |
| 6 | +--- |
| 7 | + client/image.go | 8 +++++++- |
| 8 | + 1 file changed, 7 insertions(+), 1 deletion(-) |
| 9 | + |
| 10 | +diff --git a/client/image.go b/client/image.go |
| 11 | +index 355bcba..54b5890 100644 |
| 12 | +--- a/client/image.go |
| 13 | ++++ b/client/image.go |
| 14 | +@@ -31,6 +31,7 @@ import ( |
| 15 | + "github.com/containerd/containerd/v2/internal/kmutex" |
| 16 | + "github.com/containerd/containerd/v2/pkg/labels" |
| 17 | + "github.com/containerd/containerd/v2/pkg/rootfs" |
| 18 | ++ "github.com/containerd/containerd/v2/pkg/snapshotters" |
| 19 | + "github.com/containerd/errdefs" |
| 20 | + "github.com/containerd/platforms" |
| 21 | + "github.com/opencontainers/go-digest" |
| 22 | +@@ -333,7 +334,12 @@ func (i *image) Unpack(ctx context.Context, snapshotterName string, opts ...Unpa |
| 23 | + } |
| 24 | + |
| 25 | + for _, layer := range layers { |
| 26 | +- unpacked, err = rootfs.ApplyLayerWithOpts(ctx, layer, chain, sn, a, config.SnapshotOpts, config.ApplyOpts) |
| 27 | ++ snOpts := append(config.SnapshotOpts, snapshots.WithLabels(map[string]string{ |
| 28 | ++ snapshotters.TargetLayerDigestLabel: layer.Blob.Digest.String(), |
| 29 | ++ snapshotters.TargetManifestDigestLabel: i.Target().Digest.String(), |
| 30 | ++ snapshotters.TargetRefLabel: i.Name(), |
| 31 | ++ })) |
| 32 | ++ unpacked, err = rootfs.ApplyLayerWithOpts(ctx, layer, chain, sn, a, snOpts, config.ApplyOpts) |
| 33 | + if err != nil { |
| 34 | + return fmt.Errorf("apply layer error for %q: %w", i.Name(), err) |
| 35 | + } |
| 36 | +-- |
| 37 | +2.34.1 |
| 38 | + |
0 commit comments