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

show cli flags in logs (#1807) #1827

Merged
merged 1 commit into from
Mar 2, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Feb 28, 2020

cherry-pick #1807 to release-1.1


What problem does this PR solve?

this is useful in debugging. in addition to component version, we can know CLI flags from logs.

example logs of tidb-controller-manager:

I0227 17:36:49.969981   88390 version.go:38] Welcome to TiDB Operator.
I0227 17:36:49.970745   88390 version.go:39] TiDB Operator Version: version.Info{GitVersion:"v1.1.0-beta.1.97+89e0c38525404a", GitCommit:"89e0c38525404aea9c085a64848ad36bcbcd8bf1", GitTreeState:"clean", BuildDate:"2020-02-27T09:36:35Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
I0227 17:36:49.970794   88390 main.go:97] FLAG: --V="false"
I0227 17:36:49.970805   88390 main.go:97] FLAG: --add_dir_header="false"
I0227 17:36:49.970809   88390 main.go:97] FLAG: --alsologtostderr="false"
I0227 17:36:49.970814   88390 main.go:97] FLAG: --auto-failover="true"
I0227 17:36:49.970817   88390 main.go:97] FLAG: --cluster-scoped="true"
I0227 17:36:49.970827   88390 main.go:97] FLAG: --features="AdvancedStatefulSet=false,AutoScaling=false,StableScheduling=true"
I0227 17:36:49.970859   88390 main.go:97] FLAG: --log_backtrace_at=":0"
I0227 17:36:49.970867   88390 main.go:97] FLAG: --log_dir=""
I0227 17:36:49.970871   88390 main.go:97] FLAG: --log_file=""
I0227 17:36:49.970878   88390 main.go:97] FLAG: --log_file_max_size="1800"
I0227 17:36:49.970882   88390 main.go:97] FLAG: --logtostderr="true"
I0227 17:36:49.970895   88390 main.go:97] FLAG: --pd-failover-period="5m0s"
I0227 17:36:49.970899   88390 main.go:97] FLAG: --pod-webhook-enabled="false"
I0227 17:36:49.970903   88390 main.go:97] FLAG: --resync-duration="30s"
I0227 17:36:49.970906   88390 main.go:97] FLAG: --skip_headers="false"
I0227 17:36:49.970909   88390 main.go:97] FLAG: --skip_log_headers="false"
I0227 17:36:49.970919   88390 main.go:97] FLAG: --stderrthreshold="2"
I0227 17:36:49.970943   88390 main.go:97] FLAG: --test-mode="false"
I0227 17:36:49.970948   88390 main.go:97] FLAG: --tidb-backup-manager-image="pingcap/tidb-backup-manager:latest"
I0227 17:36:49.970952   88390 main.go:97] FLAG: --tidb-discovery-image="pingcap/tidb-operator:latest"
I0227 17:36:49.970955   88390 main.go:97] FLAG: --tidb-failover-period="5m0s"
I0227 17:36:49.970958   88390 main.go:97] FLAG: --tikv-failover-period="5m0s"
I0227 17:36:49.970960   88390 main.go:97] FLAG: --v="1"
I0227 17:36:49.970970   88390 main.go:97] FLAG: --version="false"
I0227 17:36:49.970973   88390 main.go:97] FLAG: --vmodule=""
I0227 17:36:49.970977   88390 main.go:97] FLAG: --workers="5"

What is changed and how does it work?

Check List

Tests

  • Unit test
  • E2E test
  • Stability test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

  • Has Go code change
  • Has CI related scripts change
  • Has Terraform scripts change

Side effects

  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Does this PR introduce a user-facing change?:

NONE

Copy link
Contributor

@weekface weekface left a comment

Choose a reason for hiding this comment

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

LGTM

@Yisaer
Copy link
Contributor

Yisaer commented Feb 29, 2020

/run-e2e-in-kind

@cofyc
Copy link
Contributor

cofyc commented Mar 2, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 2, 2020

Your auto merge job has been accepted, waiting for 1824

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 2, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 2, 2020

@sre-bot merge failed.

@cofyc
Copy link
Contributor

cofyc commented Mar 2, 2020

/merge

@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 2, 2020

Your auto merge job has been accepted, waiting for 1831

@Yisaer
Copy link
Contributor

Yisaer commented Mar 2, 2020

/run-e2e-in-kind

@cofyc cofyc merged commit 4b324f2 into pingcap:release-1.1 Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants