From 1cb5536a2e02599a6c1f322e41dc86a4e71f6f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20F=C3=A9ron?= Date: Thu, 15 Dec 2022 10:47:46 +0100 Subject: [PATCH] Address review comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Féron --- cmd/compose/pull.go | 7 +++++-- cmd/compose/push.go | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cmd/compose/pull.go b/cmd/compose/pull.go index 7a1fde24d..492f074a0 100644 --- a/cmd/compose/pull.go +++ b/cmd/compose/pull.go @@ -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 @@ -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{ diff --git a/cmd/compose/push.go b/cmd/compose/push.go index 4f915d003..e3eefded2 100644 --- a/cmd/compose/push.go +++ b/cmd/compose/push.go @@ -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{