Move content.Fetch configuration to struct

This makes it easier for callers to call this function and populate the
config without relying on specific flags across commands.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2018-08-09 10:16:06 -04:00
parent b9eeaa1ce8
commit 3be457d7d6
2 changed files with 52 additions and 23 deletions

View File

@@ -73,7 +73,11 @@ command. As part of this process, we do the following:
}
defer done(ctx)
img, err := content.Fetch(ctx, client, ref, context)
config, err := content.NewFetchConfig(ctx, context)
if err != nil {
return err
}
img, err := content.Fetch(ctx, client, ref, config)
if err != nil {
return err
}