-
Notifications
You must be signed in to change notification settings - Fork 370
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 worker related flags from GetControllerFlags() #4279
Conversation
57142cd
to
a158006
Compare
58d624d
to
6e6aef5
Compare
This makes it obvious if something on the command line interface changes (modulo changes to hidden flags and such). Signed-off-by: Tom Wieczorek <[email protected]>
The data-dir is fetched manually from the flag sets nowadays, so the global variable was not used at all. Also use the standard pflag defaulting mechanism for printing the defaults. Signed-off-by: Tom Wieczorek <[email protected]>
Those are also part of GetWorkerFlags(). In fact, the two commands that use GetControllerFlags() ("controller" and "install"), both also add GetWorkerFlags(), defining them effectively twice. Signed-off-by: Tom Wieczorek <[email protected]>
6e6aef5
to
756001d
Compare
756001d
to
89723c9
Compare
This will reject logging settings for unknown component names and introduces a deterministic output in the Cobra command's help texts. Remove the unused kube-proxy component from logging. Signed-off-by: Tom Wieczorek <[email protected]>
89723c9
to
01c7bc9
Compare
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.
Change looks good and it is a good idea to have tests to detect changes in the user facing API aka the CLI flags.
But I think doing that outside of go (or having large chunks of xample output embedded in go tests) via some "golden tests" / characterization testing might be something to explore.
In fact, having something like that in place before this PR would make this PR very easy to validate.
Hmm, for a start, we can as well just have the output in separate files and use go:embed or os.ReadFile in the tests to load those. |
Description
Those are also part of
GetWorkerFlags()
. In fact, the two commands that useGetControllerFlags()
("controller" and "install"), both also addGetWorkerFlags()
, defining them effectively twice. Add tests for the--help
output to prove that nothing changed. Make logging CLI option statically typed, which will reject logging settings for unknown component names and introduces a deterministic output in the Cobra command's help texts. Remove the unused kube-proxy component from logging.Type of change
How Has This Been Tested?
Checklist: