Pass snapshotter opts during Pull
For remote snapshotter cases it's quite often there is need to pass extra info from client (for instance - registry URL to query remote layer from, credentials, etc). This commit slightly extends WithPullSnapshotter to pass extra labels to a snapshotter. Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
This commit is contained in:
@@ -22,6 +22,8 @@ import (
|
||||
"github.com/containerd/containerd/images"
|
||||
"github.com/containerd/containerd/platforms"
|
||||
"github.com/containerd/containerd/remotes"
|
||||
"github.com/containerd/containerd/snapshots"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
@@ -138,10 +140,11 @@ func WithUnpackOpts(opts []UnpackOpt) RemoteOpt {
|
||||
}
|
||||
}
|
||||
|
||||
// WithPullSnapshotter specifies snapshotter name used for unpacking
|
||||
func WithPullSnapshotter(snapshotterName string) RemoteOpt {
|
||||
// WithPullSnapshotter specifies snapshotter name used for unpacking.
|
||||
func WithPullSnapshotter(snapshotterName string, opts ...snapshots.Opt) RemoteOpt {
|
||||
return func(_ *Client, c *RemoteContext) error {
|
||||
c.Snapshotter = snapshotterName
|
||||
c.SnapshotterOpts = opts
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user