-
Notifications
You must be signed in to change notification settings - Fork 597
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
[release-1.28] Remove handling code for glog #2534
Merged
k8s-ci-robot
merged 5 commits into
kubernetes:release-1.28
from
k8s-infra-cherrypick-robot:cherry-pick-2325-to-release-1.28
Feb 8, 2024
Merged
[release-1.28] Remove handling code for glog #2534
k8s-ci-robot
merged 5 commits into
kubernetes:release-1.28
from
k8s-infra-cherrypick-robot:cherry-pick-2325-to-release-1.28
Feb 8, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The comment here seems to have been left over when this module was extensively reworked in commit 7f1e9ed (kubernetes#2278). In any case, it's unnecessary: the call to 'klog.InitFlags' with a 'nil' argument results in the flags being registered against the global 'flag.CommandLine' flagset [1], but since cobra uses pflag rather than flag this doesn't do anything useful. You can validate this by simply building the binary without this change: you'll note that we only have '-v' and '-vmodule' arguments, which are actually added by 'cli.Run' [2][3][4]. As such, we can simply remove the calls. [1] https://github.com/kubernetes/klog/blob/v2.100.1/klog.go#L432-L434 [2] https://github.com/kubernetes/component-base/blob/v0.28.1/cli/run.go#L46 [3] https://github.com/kubernetes/component-base/blob/v0.28.1/cli/run.go#L120 [4] https://github.com/kubernetes/component-base/blob/v0.28.1/logs/logs.go#L73-L105 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
The kubernetes ecosystem has migrated to klog now and the flags registered are for klog [1]. As such, there is no need to continue translating from glog to klog. [1] https://github.com/kubernetes/component-base/blob/v0.28.1/logs/logs.go#L73-L105 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Remove the code to handle translation of legacy glog options to klog options since glog is no longer a thing in kubernetes. Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
As with our earlier change to cinder-csi-plugin, the handling code for glog is no longer necessary now that the kubernetes ecosystem has migrated to klog. However, unlike that change, client-keystone-auth is not using cobra but rather plain old pflag. As a result, it is still actually registering all the klog options. We preserve this behavior. Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This is quite similar but not identical to the earlier removal of glog handling in client-keystone-auth. As with that utility, we are using pflag rather than cobra here, but unlike that utility the klog options are not being registered. Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dulek 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 |
/hold This is a weird error. |
/retest |
/hold cancel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
approved
Indicates a PR has been approved by an approver from all required OWNERS files.
cncf-cla: yes
Indicates the PR's author has signed the CNCF CLA.
lgtm
"Looks good to me", indicates that a PR is ready to be merged.
release-note-none
Denotes a PR that doesn't merit a release note.
size/L
Denotes a PR that changes 100-499 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an automated cherry-pick of #2325
/assign jichenjc