Allow to import an image for the default platform only.

Add `all-platforms` option to `ctr images import`.

Signed-off-by: Aldo Culquicondor <acondor@google.com>
This commit is contained in:
Aldo Culquicondor
2019-03-19 10:55:55 -04:00
parent a378dbc2ab
commit 9a8727cf09
2 changed files with 24 additions and 3 deletions

View File

@@ -64,6 +64,10 @@ If foobar.tar contains an OCI ref named "latest" and anonymous ref "sha256:deadb
Name: "index-name",
Usage: "image name to keep index as, by default index is discarded",
},
cli.BoolFlag{
Name: "all-platforms",
Usage: "imports content for all platforms, false by default",
},
}, commands.SnapshotterFlags...),
Action: func(context *cli.Context) error {
@@ -89,6 +93,8 @@ If foobar.tar contains an OCI ref named "latest" and anonymous ref "sha256:deadb
opts = append(opts, containerd.WithIndexName(idxName))
}
opts = append(opts, containerd.WithAllPlatforms(context.Bool("all-platforms")))
client, ctx, cancel, err := commands.NewClient(context)
if err != nil {
return err