Skip to content

Commit

Permalink
fix(compose): Fix incorrect name used in re-hydrated args slice (#1574)
Browse files Browse the repository at this point in the history
Reviewed-by: Cezar Craciunoiu <[email protected]>
Approved-by: Cezar Craciunoiu <[email protected]>
  • Loading branch information
craciunoiuc authored Apr 18, 2024
2 parents 2e2a603 + 51c60c8 commit 6a9c42e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions internal/cli/kraft/cloud/compose/ps/ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"context"
"fmt"
"os"
"strings"

"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -99,8 +98,8 @@ func (opts *PsOptions) Run(ctx context.Context, args []string) error {

// if no services are specified, start all services
if len(args) == 0 {
for _, service := range opts.Project.Services {
args = append(args, strings.SplitN(service.Name, "-", 2)[1])
for service := range opts.Project.Services {
args = append(args, service)
}
}

Expand Down
5 changes: 2 additions & 3 deletions internal/cli/kraft/cloud/compose/stop/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"context"
"fmt"
"os"
"strings"
"time"

"github.com/MakeNowJust/heredoc"
Expand Down Expand Up @@ -118,8 +117,8 @@ func (opts *StopOptions) Run(ctx context.Context, args []string) error {

// If no services are specified, stop all services.
if len(args) == 0 {
for _, service := range opts.Project.Services {
args = append(args, strings.SplitN(service.Name, "-", 2)[1])
for service := range opts.Project.Services {
args = append(args, service)
}
}

Expand Down

0 comments on commit 6a9c42e

Please sign in to comment.