Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Féron <[email protected]>
  • Loading branch information
gferon authored and ndeloof committed Dec 15, 2022
1 parent e4850d9 commit 1cb5536
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions cmd/compose/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func pullCommand(p *projectOptions, backend api.Service) *cobra.Command {
return cmd
}

func FilterServices(project *types.Project, services []string) error {
func withSelectedServicesOnly(project *types.Project, services []string) error {
enabled, err := project.GetServices(services...)
if err != nil {
return err
Expand All @@ -90,7 +90,10 @@ func runPull(ctx context.Context, backend api.Service, opts pullOptions, service
}

if !opts.includeDeps {
FilterServices(project, services)
err := withSelectedServicesOnly(project, services)
if err != nil {
return err
}
}

return backend.Pull(ctx, project, api.PullOptions{
Expand Down
5 changes: 4 additions & 1 deletion cmd/compose/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ func runPush(ctx context.Context, backend api.Service, opts pushOptions, service
}

if !opts.IncludeDeps {
FilterServices(project, services)
err := withSelectedServicesOnly(project, services)
if err != nil {
return err
}
}

return backend.Push(ctx, project, api.PushOptions{
Expand Down

0 comments on commit 1cb5536

Please sign in to comment.