From a127e026e4c0d83467414d175298562be41592fa Mon Sep 17 00:00:00 2001 From: r-vasquez Date: Wed, 22 May 2024 08:26:38 -0700 Subject: [PATCH 1/4] rpk: add missing new line in rpk cloud login message (cherry picked from commit 4382e41f9d6aba03cd1895aeeb08ebf6ad1580ec) --- src/go/rpk/pkg/cli/cloud/login.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/rpk/pkg/cli/cloud/login.go b/src/go/rpk/pkg/cli/cloud/login.go index 0fb02ef63e076..05e9841113ba5 100644 --- a/src/go/rpk/pkg/cli/cloud/login.go +++ b/src/go/rpk/pkg/cli/cloud/login.go @@ -156,7 +156,7 @@ rpk will talk to a localhost:9092 cluster until you swap to a different profile. } if p.Name == common.ContainerProfileName { - fmt.Printf("You are talking to a localhost 'rpk container' cluster (rpk profile name: %q)", p.Name) + fmt.Printf("You are talking to a localhost 'rpk container' cluster (rpk profile name: %q)\n", p.Name) } else { fmt.Printf("You are talking to a self hosted cluster (rpk profile name: %q)\n", p.Name) } From 499d53b6726f8231556ef9d291d16df1f422be91 Mon Sep 17 00:00:00 2001 From: r-vasquez Date: Wed, 22 May 2024 08:27:01 -0700 Subject: [PATCH 2/4] rpk: change error check for empty orgs error (cherry picked from commit 955ac66a155049271bfb37db8d06b87f19b4f6c3) --- src/go/rpk/pkg/cli/profile/create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/rpk/pkg/cli/profile/create.go b/src/go/rpk/pkg/cli/profile/create.go index 05669694624b7..c786a2b43d79c 100644 --- a/src/go/rpk/pkg/cli/profile/create.go +++ b/src/go/rpk/pkg/cli/profile/create.go @@ -198,7 +198,7 @@ func CreateFlow( var err error o, err = createCloudProfile(ctx, yAuthVir, cfg, fromCloud) if err != nil { - if err == ErrNoCloudClusters { + if errors.Is(err, ErrNoCloudClusters) { fmt.Println("Your cloud account has no clusters available to select, avoiding creating a cloud profile.") return nil } From 6edb8b816cc0076e3eb96af85f149a1bce41ee7b Mon Sep 17 00:00:00 2001 From: r-vasquez Date: Wed, 22 May 2024 08:57:22 -0700 Subject: [PATCH 3/4] rpk: remove unnecessary [wasm] in deploy help text The command don't need arguments. (cherry picked from commit 30409e444e50af4968330aa5577a9c7258aa52da) --- src/go/rpk/pkg/cli/transform/deploy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/rpk/pkg/cli/transform/deploy.go b/src/go/rpk/pkg/cli/transform/deploy.go index b45271b133036..220b01f7105e8 100644 --- a/src/go/rpk/pkg/cli/transform/deploy.go +++ b/src/go/rpk/pkg/cli/transform/deploy.go @@ -37,7 +37,7 @@ func newDeployCommand(fs afero.Fs, p *config.Params) *cobra.Command { var file string cmd := &cobra.Command{ - Use: "deploy [WASM]", + Use: "deploy", Short: "Deploy a transform", Long: `Deploy a transform. From c7d308954dca3690a49b55043dec0bfd1148d3b6 Mon Sep 17 00:00:00 2001 From: r-vasquez Date: Wed, 22 May 2024 09:16:52 -0700 Subject: [PATCH 4/4] rpk: avoid checking for topic existence with regex Fixes #18602 (cherry picked from commit 673674780619dc08d99c3ab1e04edae047d6c9ca) --- src/go/rpk/pkg/cli/topic/consume.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/go/rpk/pkg/cli/topic/consume.go b/src/go/rpk/pkg/cli/topic/consume.go index a5fd56e25f3c9..4c1eac621bd63 100644 --- a/src/go/rpk/pkg/cli/topic/consume.go +++ b/src/go/rpk/pkg/cli/topic/consume.go @@ -89,13 +89,15 @@ func newConsumeCommand(fs afero.Fs, p *config.Params) *cobra.Command { out.MaybeDie(err, "unable to initialize admin kafka client: %v", err) // We fail if the topic does not exist. - listed, err := adm.ListTopics(cmd.Context(), topics...) - out.MaybeDie(err, "unable to check topic existence: %v", err) - listed.EachError(func(d kadm.TopicDetail) { - if errors.Is(d.Err, kerr.UnknownTopicOrPartition) { - out.Die("unable to consume topic %q: %v", d.Topic, d.Err.Error()) - } - }) + if !c.regex { + listed, err := adm.ListTopics(cmd.Context(), topics...) + out.MaybeDie(err, "unable to check topic existence: %v", err) + listed.EachError(func(d kadm.TopicDetail) { + if errors.Is(d.Err, kerr.UnknownTopicOrPartition) { + out.Die("unable to consume topic %q: %v", d.Topic, d.Err.Error()) + } + }) + } err = c.parseOffset(offset, topics, adm) out.MaybeDie(err, "invalid --offset %q: %v", offset, err)