-
Notifications
You must be signed in to change notification settings - Fork 72
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
feat(kafka): add --wait flag to perform synchronous Kafka creation #960
Conversation
@@ -88,6 +90,11 @@ func (s *IOStreams) IsSSHSession() bool { | |||
return hasClient || hasTTY | |||
} | |||
|
|||
// NewSpinner returns a new spinner progress bar to be used in synchronous commands | |||
func (s *IOStreams) NewSpinner() *spinner.Spinner { |
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.
CC @ankithans
pkg/cmd/kafka/create/create.go
Outdated
|
||
for svcstatus.IsCreating(response.GetStatus()) { | ||
time.Sleep(cmdutil.DefaultPollTime) | ||
s.Suffix = " " + opts.localizer.MustLocalize("kafka.create.log.info.creationInProgress", localize.NewEntry("Name", response.GetName()), localize.NewEntry("Status", color.Info(response.GetStatus()))) |
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.
s.Suffix = " " + opts.localizer.MustLocalize("kafka.create.log.info.creationInProgress", localize.NewEntry("Name", response.GetName()), localize.NewEntry("Status", color.Info(response.GetStatus()))) | |
s.Suffix = " " + opts.localizer.MustLocalize("kafka.create.log.info.creationInProgress", | |
localize.NewEntry("Name", response.GetName()), | |
localize.NewEntry("Status", color.Info(response.GetStatus()))) |
pkg/cmd/kafka/create/create.go
Outdated
logger.Info() | ||
logger.Info() |
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.
logger.Info() | |
logger.Info() | |
logger.Info("\n\n") |
@@ -38,13 +38,23 @@ one = 'Cloud Provider Region ID' | |||
[kafka.create.flag.autoUse.description] | |||
one = 'Set the new Kafka instance to the current instance' | |||
|
|||
[kafka.create.flag.wait.description] | |||
one = 'Wait for the Kafka instance to finish creating' |
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.
one = 'Wait for the Kafka instance to finish creating' | |
one = 'Wait until the Kafka instance is created' |
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.
Yeah I like that. Will look into it. |
I have added logic to detect a SIGINT and shows an appropriate message. Mind checking that? |
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.
Looks great! Just a typo.
6ae5f04
to
1d4f25d
Compare
1d4f25d
to
3d5b59a
Compare
Closes #604
Verification Steps
rhoas kafka create my-kafka -w
Type of change
Checklist