Skip to content

Commit

Permalink
rpk: stop using args[0] in cloud cluster select
Browse files Browse the repository at this point in the history
There might be cases where the user is using
rpk cloud cluster select in a single-cluster org
and args will be null, causing a panic.

Fixes #18270
  • Loading branch information
r-vasquez committed May 8, 2024
1 parent f509e0b commit 3a9d171
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/go/rpk/pkg/cli/cloud/cluster/select.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ an existing self-hosted profile, please rename that profile or use the
Either:
rpk profile select %[1]q
rpk profile rename-to $something_else
rpk cloud cluster select %[2]q
rpk cloud cluster select [NAME]
Or:
rpk cloud cluster select %[2]q --profile $another_something
`, ee.Name, args[0])
rpk cloud cluster select [NAME] --profile $another_something
`, ee.Name)
os.Exit(1)
}
out.MaybeDieErr(err)
Expand Down

0 comments on commit 3a9d171

Please sign in to comment.