-
Notifications
You must be signed in to change notification settings - Fork 39.5k
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 deprecated kube-apiserver flags #62621
Show deprecated kube-apiserver flags #62621
Conversation
/retest |
diff of help message:
|
// Unhide deprecated flags. We want deprecated flags to show in kube-apiserver help. | ||
// We have some hidden flags, but we might as well unhide these when they are deprecated, | ||
// as silently deprecating and removing (even hidden) things is unkind to people who use them. | ||
fs.VisitAll(func(flag *pflag.Flag) { |
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.
didn't know this is possible so easily 👍
There are many flags (also in other components) with "Deprecated" in its description. Can we call |
I am working on |
@CaoShuFeng for easier approval, you can open multiple PRs if that helps. |
// as silently deprecating and removing (even hidden) things is unkind to people who use them. | ||
fs.VisitAll(func(flag *pflag.Flag) { | ||
if len(flag.Deprecated) > 0 { | ||
flag.Hidden = false |
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.
Hi, will this take the hidden flag back?
What should I do if I do want to hide it?
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.
Ref #62009 (comment)
This is intended.
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.
OK.
What should I do if I do want to hide it?
I do not want to hide it. 😆
I don't think we need to make all of the apiserver flags visible like this. The reason we did that for the kubelet was that all flags that could be specified via config file were marked deprecated, which made most of the kubelet flags invisible, despite their function still being supported. The only ones I would add back are |
But how can we make it? like this
|
func (s *InsecureServingOptions) AddFlags(fs *pflag.FlagSet) {
fs.IPVar(&s.BindAddress, "insecure-bind-address", s.BindAddress, ""+
"The IP address on which to serve the --insecure-port (set to 0.0.0.0 for all IPv4 interfaces and :: for all IPv6 interfaces).")
fs.MarkDeprecated("insecure-bind-address", "This flag will be removed in a future version.")
+ fs.Lookup("insecure-bind-address").Hidden = false
fs.IntVar(&s.BindPort, "insecure-port", s.BindPort, ""+
"The port on which to serve unsecured, unauthenticated access. It is assumed "+
"that firewall rules are set up such that this port is not reachable from outside of "+
"the cluster and that port 443 on the cluster's public address is proxied to this "+
"port. This is performed by nginx in the default setup. Set to zero to disable.")
fs.MarkDeprecated("insecure-port", "This flag will be removed in a future version.")
+ fs.Lookup("insecure-port").Hidden = false
} |
31899b3
to
8f98af9
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu, liggitt 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 |
Automatic merge from submit-queue (batch tested with PRs 58784, 62057, 62621, 62652, 62656). If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it:
This PR unhides deprecated kube-apiserver flags, so that the deprecation notice is clearly visible in --help.
Fixes #62617
Release note: