-
Notifications
You must be signed in to change notification settings - Fork 39.6k
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
Refactoring: improved logging for errors #124389
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
Hi @holgerson97. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/kind cleanup |
/ok-to-test |
/retest |
I had a change in my gRPC vendor folder which I used for something different. I cleaned it up. |
pkg/kubelet/config/flags.go
Outdated
"runtime-cgroups", | ||
s.RuntimeCgroups, | ||
"Optional absolute name of cgroups to create and run the runtime in.", | ||
) |
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.
As far as I can see this project mostly follows another code style. I'm not sure it makes sense to change it, at least not in one place.
kubernetes (master) $ git grep 'fs\..*Var(' | wc -l
599
kubernetes (master) $ git grep 'fs\..*Var($' | wc -l
8
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.
Reverted my changes.
pkg/kubelet/config/file.go
Outdated
podAdd podEventType = iota | ||
podModify | ||
podDelete | ||
|
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.
All of the removed constants and podEventType
are used in the code.
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.
Reverted my changes.
@holgerson97 Please, fix CI test failures, thanks. |
…e fails" This reverts commit 08f7312.
/retest-required |
/retest |
/remove-lifecycle stale |
I reviewed my changes and adapted accordingly to your comments. I trimmed down this RP to two small changes. |
This reverts commit e71b5c0.
pkg/kubelet/config/flags.go
Outdated
@@ -50,7 +50,7 @@ type ContainerRuntimeOptions struct { | |||
func (s *ContainerRuntimeOptions) AddFlags(fs *pflag.FlagSet) { | |||
// General settings. | |||
fs.StringVar(&s.RuntimeCgroups, "runtime-cgroups", s.RuntimeCgroups, "Optional absolute name of cgroups to create and run the runtime in.") | |||
fs.StringVar(&s.PodSandboxImage, "pod-infra-container-image", s.PodSandboxImage, fmt.Sprintf("Specified image will not be pruned by the image garbage collector. CRI implementations have their own configuration to set this image.")) | |||
fs.StringVar(&s.PodSandboxImage, "pod-infra-container-image", s.PodSandboxImage, fmt.Sprint("Specified image will not be pruned by the image garbage collector. CRI implementations have their own configuration to set this image.")) |
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.
fs.StringVar(&s.PodSandboxImage, "pod-infra-container-image", s.PodSandboxImage, fmt.Sprint("Specified image will not be pruned by the image garbage collector. CRI implementations have their own configuration to set this image.")) | |
fs.StringVar(&s.PodSandboxImage, "pod-infra-container-image", s.PodSandboxImage, "Specified image will not be pruned by the image garbage collector. CRI implementations have their own configuration to set this image.") |
m.merger.Merge(source, update) | ||
if err := m.merger.Merge(source, update); err != nil { | ||
klog.InfoS("failed merging update", "err", err) | ||
} |
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.
The only implementation of the merger
interface I could find is this and it never returns error. It doesn't mean it will not do it in future, but still.
@@ -50,7 +50,7 @@ type ContainerRuntimeOptions struct { | |||
func (s *ContainerRuntimeOptions) AddFlags(fs *pflag.FlagSet) { | |||
// General settings. | |||
fs.StringVar(&s.RuntimeCgroups, "runtime-cgroups", s.RuntimeCgroups, "Optional absolute name of cgroups to create and run the runtime in.") | |||
fs.StringVar(&s.PodSandboxImage, "pod-infra-container-image", s.PodSandboxImage, fmt.Sprint("Specified image will not be pruned by the image garbage collector. CRI implementations have their own configuration to set this image.")) | |||
fs.StringVar(&s.PodSandboxImage, "pod-infra-container-image", s.PodSandboxImage, fmt.Sprintf("Specified image will not be pruned by the image garbage collector. CRI implementations have their own configuration to set this image.")) |
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.
BTW, it was a valid update. fmt.Sprintf is not needed 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.
Thanks!
/lgtm
/approve
LGTM label has been added. Git tree hash: 3a9bce6eaf3b13e97781646caff6002e648b1a08
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: holgerson97, thockin 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 |
What type of PR is this?
I am refactoring the the kubelet config package.
What this PR does / why we need it:
I improves readability and removes stale code. Also there is logging statement introduced to make debugging easier.
We should keep housekeeping/cleanup of existing codebase.
Which issue(s) this PR fixes:
None.
Special notes for your reviewer:
Does this PR introduce a user-facing change?
There is a new debugging log line.
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: