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
Migrate ttl_controller to contextual logging #113916
Conversation
Hi @songxiao-wang87. 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. |
pkg/controller/ttl/ttl_controller.go
Outdated
if err != nil { | ||
klog.Errorf("Couldn't get key for object %+v", node) | ||
logger.Error(err, "Couldn't get key for object", "object", node) |
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.
logger.Error(err, "Couldn't get key for object", "object", node) | |
logger.Error(nil, "Couldn't get key for object", "object", klog.KObj(node) |
pkg/controller/ttl/ttl_controller.go
Outdated
if err != nil { | ||
klog.Errorf("Couldn't get key for object %+v", node) | ||
logger.Error(err, "Couldn't get key for object", "object", node) | ||
klog.FlushAndExit(klog.ExitFlushTimeout, 1) |
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.
klog.FlushAndExit(klog.ExitFlushTimeout, 1) |
pkg/controller/ttl/ttl_controller.go
Outdated
klog.Warningf("Cannot convert the value %q with annotation key %q for the node %q", | ||
annotationValue, annotationKey, node.Name) | ||
logger.Info("Cannot convert the value with annotation key for the node", "annotationValue", | ||
annotationValue, "annotationKey", annotationKey, "nodeName", node.Name) |
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.
annotationValue, "annotationKey", annotationKey, "nodeName", node.Name) | |
annotationValue, "annotationKey", annotationKey, "node", klog.KObj(node)) |
/sig instrumentation |
/cc @pohly @shivanshu1333 |
39c52fc
to
ea170c2
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.
/ok-to-test
Also need to modify the file |
ea170c2
to
e9fff82
Compare
/assign @soltysh For approval. |
/assign @soltysh |
Suggestion for the release note: Migrated the “TTL after finished” controller (within `kube-controller-manager`) to use [contextual logging](https://k8s.io/docs/concepts/cluster-administration/system-logs/#contextual-logging). AIUI, end users could observe this change. |
Signed-off-by: songxiao-wang87 <wang.xiaosong23@zte.com.cn>
ac068c4
to
8c7f3c2
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.
/lgtm
LGTM label has been added. Git tree hash: 42663067a0eab1fc3b943e1f10a1ec41977ad1f8
|
/test pull-kubernetes-unit |
@songxiao-wang87: can you add the changelog entry to your PR description? |
/assign @soltysh For approval. |
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.
/approve
/priority important-longterm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, pohly, soltysh, songxiao-wang87, yangjunmyfm192085 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?
/kind feature
What this PR does / why we need it:
Update the ttl controller to use contextual logging.
Which issue(s) this PR fixes:
Part of kubernetes/enhancements#3077
Special notes for your reviewer:
Does this PR introduce a user-facing change?