Merge pull request #4820 from AkihiroSuda/additional-pull-opts

ctr: FetchConfig: allow setting additional []containerd.RemoteOpt
This commit is contained in:
Wei Fu 2020-12-10 00:38:59 +08:00 committed by GitHub
commit 7b0149ac4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,6 +108,8 @@ type FetchConfig struct {
Platforms []string
// Whether or not download all metadata
AllMetadata bool
// RemoteOpts is not used by ctr, but can be used by other CLI tools
RemoteOpts []containerd.RemoteOpt
}
// NewFetchConfig returns the default FetchConfig from cli flags
@ -172,6 +174,7 @@ func Fetch(ctx context.Context, client *containerd.Client, ref string, config *F
containerd.WithImageHandler(h),
containerd.WithSchema1Conversion,
}
opts = append(opts, config.RemoteOpts...)
if config.AllMetadata {
opts = append(opts, containerd.WithAllMetadata())