-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
refactor registry command to Complete-Validate-Run #9236
Conversation
[test] |
re[test] |
@@ -131,6 +141,9 @@ func NewCmdRegistry(f *clientcmd.Factory, parentName, name string, out io.Writer | |||
Long: registryLong, | |||
Example: fmt.Sprintf(registryExample, parentName, name), | |||
Run: func(cmd *cobra.Command, args []string) { | |||
kcmdutil.CheckErr(cfg.Complete(f, cmd, out, args)) | |||
kcmdutil.CheckErr(cfg.Validate(cmd, args)) | |||
|
|||
err := RunCmdRegistry(f, cmd, out, cfg, args) |
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 should be turned into kcmdutil.CheckErr(cfg.Run())
as well.
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.
The out
here can be moved into RegistryConfig
, args
not needed at all.
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 didn't change it because of the ErrExit
handling below which would change the overall behavior. I can look at that portion more
f6de223
to
118f827
Compare
updated for feedback |
nodeSelector map[string]string | ||
ports []kapi.ContainerPort | ||
namespace string | ||
kClient *kclient.Client |
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.
Is this a service namespacer?
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.
yes
799f9f3
to
6cac0cd
Compare
6cac0cd
to
abbf350
Compare
image := cfg.ImageTemplate.ExpandOrDie(cfg.Type) | ||
if ports, err := app.ContainerPortsFromString(opts.Config.Ports); err != nil { | ||
return err | ||
} else { |
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.
else
not needed.
Nits, overall LGTM. Thank you! |
abbf350
to
9b5fa12
Compare
nits fixed |
@csrwng merge is at your disposal |
9b5fa12
to
611214a
Compare
LGTM [merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/4938/) (Image: devenv-rhel7_4383) |
Evaluated for origin merge up to 611214a |
Evaluated for origin test up to 611214a |
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/4907/) |
yum flake #9203 [merge] |
@soltysh - for repayment of the Krowka candy you brought here is the refactoring I owed you.
Fixes #8390