-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(kafka create): run interactive if no name provided and fix typos #705
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I pass the --provider
flag, it will re-prompt me to enter the provider value in the interactive prompt:
❯ ./rhoas kafka create --provider aws
? Name: my-kafka
? Cloud Provider: [Use arrows to move, type to filter]
> aws
The way it was (supposed to be) working before now was as follows:
If no name argument is passed, and any value flag is passed, such as provider, then throw an error as the user is trying to mix interactive with non-interactive Kafka creation.
I think that this is more maintainable in the long run, and I believe it is consistent with the other create commands (not sure though).
@@ -69,6 +69,9 @@ one = "Geographical region where the Kafka instance will be deployed" | |||
[kafka.create.argument.name.error.requiredWhenNonInteractive] | |||
one = 'name is required. Run "rhoas kafka create <name>"' | |||
|
|||
[kafka.create.flags.notAllowedWhenInteractive] | |||
one = 'region and provider flags not allowed for interactive Kafka instance creation' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion for a better error message @craicoverflow ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swap it round like something like this: "name" argument is required when creating a Kafka instance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to 'name is required. Run "rhoas kafka create <name>"'
fc3b6a9
to
1f41972
Compare
rhoas kafka create
is run with flags but no name.Closes #703, #704
Verification Steps
rhoas kafka create --provider aws
, it should open the interactive mode.rhoas kafka consumergroup list --topic <topic-name>
where the topic has no associated consumergroup, it should display the messageKafka instance "<instance name>" has no consumer groups for topic "<topic-name>"
Type of change
Checklist