Skip to content

Commit

Permalink
rpk profile create: use StringArray rather than StringSlice
Browse files Browse the repository at this point in the history
StringSlice splits all inputs at comma, meaning config.Set cannot work.
Currently, people can only input one key=value. If people use a second
value (key=value1,value2), the input is split at comma and then
config.Set runs against value2 alone (no key) and fails.

(cherry picked from commit 80f41e4)
  • Loading branch information
twmb authored and vbotbuildovich committed Sep 11, 2023
1 parent 07ed9f7 commit b623c8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/go/rpk/pkg/cli/profile/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ rpk always switches to the newly created profile.
},
}

cmd.Flags().StringSliceVarP(&set, "set", "s", nil, "Create and switch to a new profile, setting profile fields with key=value pairs")
cmd.Flags().StringArrayVarP(&set, "set", "s", nil, "Create and switch to a new profile, setting profile fields with key=value pairs")
cmd.Flags().StringVar(&fromRedpanda, "from-redpanda", "", "Create and switch to a new profile from a redpanda.yaml file")
cmd.Flags().StringVar(&fromProfile, "from-profile", "", "Create and switch to a new profile from an existing profile or from a profile in a yaml file")
cmd.Flags().StringVar(&fromCloud, "from-cloud", "", "Create and switch to a new profile generated from a Redpanda Cloud cluster ID")
Expand Down

0 comments on commit b623c8f

Please sign in to comment.