Skip to content

[CLI-1454] Modify potentially misleading flag suggestions#1482

Merged
Steven Gagniere (sgagniere) merged 3 commits intomainfrom
cli-1454
Oct 26, 2022
Merged

[CLI-1454] Modify potentially misleading flag suggestions#1482
Steven Gagniere (sgagniere) merged 3 commits intomainfrom
cli-1454

Conversation

@sgagniere
Copy link
Member

Checklist

  1. [CRUCIAL] Is the change for CP or CCloud functionalities that are already live in prod?
    • yes: ok

What

Trying to run api-key store x x without an active cluster and without the --resource flag gives a suggestion to pass --cluster or --resource, but --cluster is not an allowed flag for this command.

I've modified api-key store to discard the error from GetKafkaClusterForCommand() and instead return an error with a suggestion tailored to this command (which was already being used further down).

On a survey of kafka, connect, ksql and pipeline commands, which all have the potential to see this same error message, none of them as far as I can tell accept --resource as a valid flag, so the suggestion is also misleading for these commands and their subcommands.

Based on that, I've changed the suggestion back to a previous version which only suggested the --cluster flag. Other api-key commands either have --resource marked as REQUIRED or else don't need a resource or cluster, so this shouldn't result in more misleading errors.

References

https://confluentinc.atlassian.net/browse/CLI-1454

Test & Review

Tested manually and ran all tests

@sgagniere Steven Gagniere (sgagniere) requested a review from a team as a code owner October 26, 2022 01:12
@sgagniere Steven Gagniere (sgagniere) changed the title [cli-1454] Modify potentially misleading flag suggestions [CLI-1454] Modify potentially misleading flag suggestions Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants