Skip to content
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

Merged
merged 3 commits into from
Aug 10, 2022
Merged

Conversation

Itxaka
Copy link
Contributor

@Itxaka Itxaka commented Aug 10, 2022

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]

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]>
@Itxaka Itxaka added the area/operator operator related changes label Aug 10, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #126 (9ef5dcc) into main (3ec367f) will not change coverage.
The diff coverage is n/a.

@@           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.

Copy link
Member

@fgiudici fgiudici left a 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")
Copy link
Member

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 😆

Copy link
Contributor Author

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 😢

@Itxaka Itxaka merged commit 01fd853 into rancher:main Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/operator operator related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix default operator-image in the chart
3 participants