-
Notifications
You must be signed in to change notification settings - Fork 39.7k
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
Fix missing glog flags for some commands which output flags in logical sections #70164
Conversation
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 see that bug before, thanks for your PR 👍
- have you try in your local Env?
- more please refer to ``kube-scheduler kube-scheduler: output flags in logical sections #68054
BTW, I recommend split this PR into three part
Authorization: kubeoptions.NewBuiltInAuthorizationOptions(), | ||
CloudProvider: kubeoptions.NewCloudProviderOptions(), | ||
StorageSerialization: kubeoptions.NewStorageSerializationOptions(), | ||
APIEnablement: genericoptions.NewAPIEnablementOptions(), | ||
|
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 change in here?
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.
Just indentation issues: aligning those variables.
may be some bazel failed, but go head |
@stewart-yu Yes, I have tried it in my local environment. It shows up right now. e.g. That works too. Let's wait for the tests. If all is good, I will split the PR into 3 parts tomorrow. |
@stewart-yu I made a comment in your other PR. It seems like with your other patch, we can just do the following options.AddGlobalFlags(namedFlagSets.FlagSet("global")) Ref: https://github.com/kubernetes/kubernetes/pull/68054/files#diff-f072139971e3329bef6da077a5a03aceR121 I guess we can merge this PR first (without splitting), wait until your other patch lands, and finally use the |
Signed-off-by: Jay Lim <jay@imjching.com>
04316b7
to
ec6832e
Compare
Okay, looks like there were issues with formatting. I just updated the commit. Will need to retest. |
Golog flag seems not belong to |
/hold |
/lgtm |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: imjching, sttts If they are not already assigned, you can assign the PR to them by writing 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 |
@@ -235,5 +236,7 @@ func (s *ServerRunOptions) Flags() (fss apiserverflag.NamedFlagSets) { | |||
fs.StringVar(&s.ServiceAccountSigningKeyFile, "service-account-signing-key-file", s.ServiceAccountSigningKeyFile, ""+ | |||
"Path to the file that contains the current private key of the service account token issuer. The issuer will sign issued ID tokens with this private key. (Requires the 'TokenRequest' feature gate.)") | |||
|
|||
fs.AddGoFlagSet(goflag.CommandLine) |
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 seems a bit redundant as we are already doing it https://github.com/kubernetes/kubernetes/blob/master/cmd/kube-apiserver/apiserver.go#L47 for the stand-alone KAS binary.
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.
In #64517, we introduced logical sections, and with that, we no longer read from pflag.CommandLine
for the list of flags. #68054 introduced some changes in apiserver/pkg/util/flag/
. I'm waiting for that to be merged. See #70204. Sorry! I should probably close this PR since I have broken it down into three individual PRs.
What type of PR is this?
/kind bug
What this PR does / why we need it:
Some binaries (e.g.
kube-apiserver
,kube-controller-manager
,cloud-controller-manager
) tend to output flags in logical sections. This feature was introduced in #64517 and #67362. It seems like it does not consider glog-related flags. This PR includes these glog flags in the named section "misc".The glog related flags are initialized in the
init
function (when we include theglog
package).kubernetes/vendor/github.com/golang/glog/glog.go
Lines 399 to 404 in 0d17976
Which issue(s) this PR fixes:
See #70145.
Special notes for your reviewer: I am not quite sure if we're planning to switch everything to logical sections. If yes, we might be able to abstract this so that we don't need to manually add glog commands in the misc section.
Does this PR introduce a user-facing change?:
/sig cli
cc @sttts @stewart-yu