add cli option to download all manifests

- Add `all-manifests` option to both `ctr content fetch` and `ctr
  images pull`. By default it is false.
- This option ties to `AppendDistributionSourceLabel` in client.

Signed-off-by: Yu Yi <yiyu@google.com>
This commit is contained in:
Yu Yi
2019-03-25 11:23:26 -04:00
committed by Derek McGowan
parent 4a2f61c4f2
commit 9e183f5e52
3 changed files with 30 additions and 5 deletions

View File

@@ -53,6 +53,10 @@ command. As part of this process, we do the following:
Name: "all-platforms",
Usage: "pull content from all platforms",
},
cli.BoolFlag{
Name: "all-manifests",
Usage: "Pull manifests from all platforms and layers for a specific platform",
},
),
Action: func(context *cli.Context) error {
var (
@@ -78,6 +82,10 @@ command. As part of this process, we do the following:
if err != nil {
return err
}
if context.Bool("all-manifests") {
config.IsAllManifests = context.Bool("all-manifests")
}
img, err := content.Fetch(ctx, client, ref, config)
if err != nil {
return err