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

Prase command line flags #406

Merged
merged 3 commits into from
Nov 15, 2023

Conversation

ronensc
Copy link
Contributor

@ronensc ronensc commented Nov 14, 2023

Issue link

What changes have been made

  • Added a call to flag.Parse() to parse command line flags.
  • Updated glog module to fix panic on help message (./bin/manager --help).

Verification steps

Running bin/manager --help should output:

Usage of bin/manager:
  -alsologtostderr
     log to standard error as well as files
  -config string
     The name of the ConfigMap to load the operator configuration from. If it does not exist, the operator will create and initialise it. (default "codeflare-operator-config")
  -kubeconfig string
     Paths to a kubeconfig. Only required if out-of-cluster.
  -log_backtrace_at value
     when logging hits line file:N, emit a stack trace
  -log_dir string
     If non-empty, write log files in this directory
  -log_link string
     If non-empty, add symbolic links in this directory to the log files
  -logbuflevel int
     Buffer log messages logged at this level or lower (-1 means don't buffer; 0 means buffer INFO only; ...). Has limited applicability on non-prod platforms.
  -logtostderr
     log to standard error instead of files
  -stderrthreshold value
     logs at or above this threshold go to stderr (default 2)
  -v value
     log level for V logs
  -vmodule value
     comma-separated list of pattern=N settings for file-filtered logging

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • Testing is not required for this change

main.go Outdated
@@ -81,6 +81,7 @@ func main() {
flag.StringVar(&configMapName, "config", "codeflare-operator-config",
"The name of the ConfigMap to load the operator configuration from. "+
"If it does not exist, the operator will create and initialise it.")
flag.Parse()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't that be called after all the flags have been bound, i.e., after zapOptions.BindFlags(flag.CommandLine)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course! good catch! thanks
Added a fix

@astefanutti
Copy link
Contributor

/lgtm

@astefanutti
Copy link
Contributor

/approve

Copy link

openshift-ci bot commented Nov 15, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: astefanutti

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@astefanutti
Copy link
Contributor

Thanks!

@openshift-merge-bot openshift-merge-bot bot merged commit f818a6b into project-codeflare:main Nov 15, 2023
6 checks passed
@ronensc ronensc deleted the parse-flags branch November 15, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants