-
Notifications
You must be signed in to change notification settings - Fork 17
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
Remove default value for flag and expand description #126
Conversation
Make sure we have a decent description for the --operator-image flag as that is used down the line by the syncer to run the display command and gather the results from the version syncer. Also remove the default value for the flag. It makes no sense to have a default value if we mark a flag as required, as that value will always be overwritten by the flag. Signed-off-by: Itxaka <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #126 +/- ##
=======================================
Coverage 29.16% 29.16%
=======================================
Files 5 5
Lines 360 360
=======================================
Hits 105 105
Misses 251 251
Partials 4 4 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
yep, having "latest" as the default tag makes a lot of sense!
@@ -62,7 +62,7 @@ func NewOperatorCommand() *cobra.Command { | |||
cmd.PersistentFlags().StringArrayVar(&config.SyncNamespaces, "sync-namespaces", []string{}, "namespace to watch for machine registrations") | |||
_ = viper.BindPFlag("sync-namespaces", cmd.PersistentFlags().Lookup("sync-namespaces")) | |||
|
|||
cmd.PersistentFlags().StringVar(&config.OperatorImage, "operator-image", "rancher/elemental-operator:"+version.Version, "this image") | |||
cmd.PersistentFlags().StringVar(&config.OperatorImage, "operator-image", "", "Operator image. Used to gather the results from the syncer by running the 'display' command") |
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 looks to me more suited for an in-code comment (for devs) than something outputted by the help of the binary 😆
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, unfortunately if we want to allow overriding this, we need a decent help for the flag :/
The idea would be to drop this somehow but I have no idea how we can not use the display command anymore to capture the logs 😢
Make sure we have a decent description for the --operator-image flag as
that is used down the line by the syncer to run the display command and
gather the results from the version syncer.
Also remove the default value for the flag. It makes no sense to have a
default value if we mark a flag as required, as that value will always
be overwritten by the flag.
Fixes #119
Signed-off-by: Itxaka [email protected]