-
Notifications
You must be signed in to change notification settings - Fork 176
Add "--service-images" to pull command #791
base: master
Are you sure you want to change the base?
Conversation
9b596e9
to
445fe77
Compare
internal/commands/pull.go
Outdated
func pullCmd(dockerCli command.Cli) *cobra.Command { | ||
var opts pullOptions | ||
|
||
cmd := &cobra.Command{ | ||
Use: "pull APP_IMAGE", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also add [OPTIONS]
here:
Use: "pull [OPTIONS] APP_IMAGE",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've force pushed a fix for this.
} | ||
defer responseBody.Close() | ||
|
||
return jsonmessage.DisplayJSONMessagesStream(responseBody, cli.Out(), cli.Out().FD(), false, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As those multiple pulls may be really verbose, should we also add a --quiet
flag to this command? WDYT @thaJeztah ?
@@ -52,5 +91,15 @@ func runPull(dockerCli command.Cli, name string) error { | |||
} | |||
fmt.Fprintf(os.Stdout, "Successfully pulled %q (%s) from %s\n", bndl.Name, bndl.Version, ref.String()) | |||
|
|||
if opts.serviceImages { | |||
ctx := context.Background() | |||
for name, image := range bndl.Images { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it makes sense to parallelize pulls here 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know what you all think. I will warn you that I know just enough about Golang that I might be dangerous doing this bit :)
Thank you @doanac for this PR!
|
This allows users in a single node configuration to optionally pull down the service images defined in an app bundle with: docker app pull --service-images [your app] Fixes: fixes docker#789 Signed-off-by: Andy Doan <[email protected]>
445fe77
to
42f1daa
Compare
Codecov Report
@@ Coverage Diff @@
## master #791 +/- ##
==========================================
- Coverage 70.03% 69.97% -0.06%
==========================================
Files 67 67
Lines 3684 3710 +26
==========================================
+ Hits 2580 2596 +16
- Misses 759 764 +5
- Partials 345 350 +5
Continue to review full report at Codecov.
|
This allows users in a single node configuration to optionally pull
down the service images defined in an app bundle with:
docker app pull --service-images [your app]
Fixes: fixes #789
Signed-off-by: Andy Doan [email protected]