mirror of https://github.com/docker/compose.git
introduce pull --include-deps
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
e6b8048e56
commit
0a05bbc84e
|
@ -28,7 +28,8 @@ import (
|
||||||
type pullOptions struct {
|
type pullOptions struct {
|
||||||
*projectOptions
|
*projectOptions
|
||||||
composeOptions
|
composeOptions
|
||||||
quiet bool
|
quiet bool
|
||||||
|
includeDeps bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func pullCommand(p *projectOptions) *cobra.Command {
|
func pullCommand(p *projectOptions) *cobra.Command {
|
||||||
|
@ -43,6 +44,7 @@ func pullCommand(p *projectOptions) *cobra.Command {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
cmd.Flags().BoolVarP(&opts.quiet, "quiet", "q", false, "Pull without printing progress information")
|
cmd.Flags().BoolVarP(&opts.quiet, "quiet", "q", false, "Pull without printing progress information")
|
||||||
|
cmd.Flags().BoolVar(&opts.includeDeps, "include-deps", false, "Also pull services declared as dependencies")
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,6 +59,15 @@ func runPull(ctx context.Context, opts pullOptions, services []string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !opts.includeDeps {
|
||||||
|
enabled, err := project.GetServices(services...)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
project.DisabledServices = append(project.DisabledServices, project.Services...)
|
||||||
|
project.Services = enabled
|
||||||
|
}
|
||||||
|
|
||||||
if opts.quiet {
|
if opts.quiet {
|
||||||
return c.ComposeService().Pull(ctx, project)
|
return c.ComposeService().Pull(ctx, project)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue