-
Notifications
You must be signed in to change notification settings - Fork 529
fix flag include problem #465
fix flag include problem #465
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@@ -58,7 +59,6 @@ member clusters and does the necessary reconciliation`, | |||
if verFlag { | |||
os.Exit(0) | |||
} | |||
PrintFlags(cmd.Flags()) |
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.
Why does this need to be removed?
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 has already been print in the "k8s.io/apiserver/pkg/util/flag", see this
opts.AddFlags(cmd.Flags()) | ||
cmd.Flags().BoolVar(&verFlag, "version", false, "Prints the Version info of controller-manager") | ||
opts.AddFlags(pflag.CommandLine) | ||
pflag.CommandLine.BoolVar(&verFlag, "version", false, "Prints the Version info of controller-manager") |
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.
Why is this line changing?
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.
two reasons:
- pflag.CommandLine is one FlagSet obj, see this, and cmd.Flags() will new another FlagSet obj., see this
- and "k8s.io/apiserver/pkg/util/flag" chooses pflag.CommandLine as default, see this
but, if you don't want to use "k8s.io/apiserver/pkg/util/flag", there will be another way:
import "flag"
opts.AddFlags(cmd.Flags())
cmd.Flags().AddGoFlagSet(flag.CommandLine)
cmd.Flags().BoolVar(&verFlag, "version", false, "Prints the Version info of controller-manager")
@magicwang-cn CI is failing to pass for a deployed control plane. Have you tested this to work locally (i.e. by deploying and running e2e tests as per the developer guide)? |
@marun oh, sorry, i will check this :) |
aa0f99d
to
a26ab8d
Compare
/retest |
The ci failure is not transient. Are you running tests locally? |
sorry, i am doing the test in my local environment now. because my environment is under proxy, so download package is a problem. please wait... |
@magicwang-cn You don't have to replicate the environment exactly, and it should be possible to replicate the failure by deploying 2 clusters with minikube (as per the user docs) running the e2e tests against that (as per the dev docs). |
a26ab8d
to
e4e051f
Compare
@marun yeah, i have found the problem(
see this and this, if use ( |
e4e051f
to
37e6842
Compare
@marun it's ok now |
@@ -67,9 +69,18 @@ member clusters and does the necessary reconciliation`, | |||
}, | |||
} | |||
|
|||
// Add the command line flags from other dependencies, but do not |
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.
What dependencies, and why is normalization required?
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.
dependencies like glog, kubebulider, etc. i will add to the comment.
normalization just convert '_' to '-', does this useless?
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.
I removed those lines and things still worked, so I think they should be removed. YAGNI (you ain't gonna need it) is a general principle of software development to avoid doing work until it is actually needed.
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.
done:)
37e6842
to
6024c86
Compare
6024c86
to
312decd
Compare
Thank you! /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: magicwang-cn, marun 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 |
ref #461