Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/cmd/api-key/command_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ func (c *command) store(cmd *cobra.Command, args []string) error {
} else {
cluster, err = c.Context.GetKafkaClusterForCommand()
if err != nil {
return err
// Replace the error msg since it suggests flags which are unavailable with this command
return errors.NewErrorWithSuggestions(errors.NoKafkaSelectedErrorMsg, errors.APIKeyNotValidForClusterSuggestions)
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/errors/error_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ const (
KafkaNotReadyErrorMsg = `Kafka cluster "%s" not ready`
KafkaNotReadySuggestions = "It may take up to 5 minutes for a recently created Kafka cluster to be ready."
NoKafkaSelectedErrorMsg = "no Kafka cluster selected"
NoKafkaSelectedSuggestions = "You must pass `--cluster` or `--resource` with the command or set an active Kafka cluster in your context with `confluent kafka cluster use`."
NoKafkaSelectedSuggestions = "You must pass `--cluster` with the command or set an active Kafka cluster in your context with `confluent kafka cluster use`."
NoKafkaForDescribeSuggestions = "You must provide the cluster ID argument or set an active Kafka cluster in your context with `ccloud kafka cluster use`."
NoAPISecretStoredErrorMsg = `no API secret for API key "%s" of resource "%s" stored in local CLI state`
NoAPISecretStoredSuggestions = "Store the API secret with `confluent api-key store %s --resource %s`."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Error: no Kafka cluster selected

Suggestions:
You must pass `--cluster` or `--resource` with the command or set an active Kafka cluster in your context with `confluent kafka cluster use`.
You must pass `--cluster` with the command or set an active Kafka cluster in your context with `confluent kafka cluster use`.
2 changes: 1 addition & 1 deletion test/fixtures/output/login/err-no-kafka.golden
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Error: no Kafka cluster selected

Suggestions:
You must pass `--cluster` or `--resource` with the command or set an active Kafka cluster in your context with `confluent kafka cluster use`.
You must pass `--cluster` with the command or set an active Kafka cluster in your context with `confluent kafka cluster use`.