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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ image:
empty: rancher/pause:3.1
# elemental-operator image is also build on registry.opensuse.org/isv/rancher/elemental/teal52/15.3/rancher/elemental-operator
repository: quay.io/costoolkit/elemental-operator
tag: ""
tag: latest
imagePullPolicy: IfNotPresent

# http[s] proxy server
Expand Down
2 changes: 1 addition & 1 deletion cmd/operator/operator/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 😢

_ = viper.BindPFlag("operator-image", cmd.PersistentFlags().Lookup("operator-image"))
_ = cobra.MarkFlagRequired(cmd.PersistentFlags(), "operator-image")

Expand Down