-
Notifications
You must be signed in to change notification settings - Fork 11
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
KUBESAW-170: Replace custom ksctl adm restart logic with the one from kubectl rollout #70
Conversation
… kubectl rollout Signed-off-by: Feny Mehta <[email protected]>
Signed-off-by: Feny Mehta <[email protected]>
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.
I've noticed that you dropped the unit test of the restart target. Let's recover it and have some sanity checks - you can take a look at the already existing kubectl wrappers for an inspiration on how to do it.
} | ||
return true, nil | ||
return kubectl.SetUpKubectlCmd(func(factory cmdutil.Factory, ioStreams genericclioptions.IOStreams) *cobra.Command { | ||
return kubectlrollout.NewCmdRolloutRestart(factory, ioStreams) |
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.
as I mentioned in our call and also in the jira story, the command should also wait until the rollout is complete
kubeConfigFlags := genericclioptions.NewConfigFlags(true).WithDeprecatedPasswordFlag() | ||
hFactory := cmdutil.NewFactory(cmdutil.NewMatchVersionFlags(kubeConfigFlags)) | ||
ioStreams := genericclioptions.IOStreams{ | ||
In: nil, // Not to forward the Standard Input | ||
Out: os.Stdout, | ||
ErrOut: os.Stderr, | ||
} | ||
|
||
hArgs := []string{"", "deployments", | ||
"--namespace", hostConfig.OperatorNamespace, | ||
"--server", hostConfig.ServerAPI, | ||
"--token", hostConfig.Token} | ||
|
||
o := kubectlrollout.NewRolloutRestartOptions(ioStreams) |
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.
this seem to be very similar to what we already have in base_kubectl.go
, let's try to reuse the already existing code if possible.
and as I mentioned in the other comment, it would be nice to wait.
return restartHostOperator(hostClusterConfig) | ||
} |
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.
btw, have you considered using PostRun
field?
closing in favour of #79 |
This is to replace the custom ksctl adm restart logic with the one from "kubectl rollout" command, so that there is no down-time that was introduced by the current custom logic.