Skip to content
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 podgc controller to contextual logging #114689

Closed

Conversation

pravarag
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

With this code change, we are migrating podgc controller to contextual logging

Which issue(s) this PR fixes:

Fixes #
Part of kubernetes/enhancements#3077

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Dec 25, 2022
@k8s-ci-robot
Copy link
Contributor

@pravarag: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Dec 25, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pravarag
Once this PR has been reviewed and has the lgtm label, please assign smarterclayton for approval by writing /assign @smarterclayton in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added sig/apps Categorizes an issue or PR as relevant to SIG Apps. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Dec 25, 2022
@pravarag
Copy link
Contributor Author

/retest

@k8s-ci-robot
Copy link
Contributor

@pravarag: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-typecheck 3c0564b link true /test pull-kubernetes-typecheck
pull-kubernetes-integration 3c0564b link true /test pull-kubernetes-integration
pull-kubernetes-conformance-kind-ga-only-parallel 3c0564b link true /test pull-kubernetes-conformance-kind-ga-only-parallel
pull-kubernetes-e2e-kind 3c0564b link true /test pull-kubernetes-e2e-kind
pull-kubernetes-e2e-kind-ipv6 3c0564b link true /test pull-kubernetes-e2e-kind-ipv6
pull-kubernetes-e2e-gce 3c0564b link true /test pull-kubernetes-e2e-gce
pull-kubernetes-e2e-gce-100-performance 3c0564b link true /test pull-kubernetes-e2e-gce-100-performance
pull-kubernetes-verify-govet-levee 3c0564b link true /test pull-kubernetes-verify-govet-levee
pull-kubernetes-unit 3c0564b link true /test pull-kubernetes-unit
pull-kubernetes-verify 3c0564b link true /test pull-kubernetes-verify

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@sftim
Copy link
Contributor

sftim commented Dec 29, 2022

I think this does need a release note, as end users could observe this change.

Copy link
Member

@Namanl2001 Namanl2001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. Probably you can see the things I pointed out in your IDE or in the failing jobs log: https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/114689/pull-kubernetes-e2e-kind/1607580766642900992

defer utilruntime.HandleCrash()

klog.Infof("Starting GC controller")
logger.Info("Starting GC controller")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.Info("Starting GC controller")
klog.FromContext(ctx).Info("Starting GC controller")

no need for an extra variable

@@ -112,19 +114,19 @@ func (gcc *PodGCController) Run(ctx context.Context) {
<-ctx.Done()
}

func (gcc *PodGCController) gc(ctx context.Context) {
func (gcc *PodGCController) gc(logger klog.Logger, ctx context.Context) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe logger can be retrived from context logger := klog.FromContext(ctx)
not sure why you've taken logger as input, similar for other funcs

@pohly
Copy link
Contributor

pohly commented Feb 15, 2023

/wg structured-logging

@pravarag: ping - do you intend to finish this PR?

@k8s-ci-robot k8s-ci-robot added the wg/structured-logging Categorizes an issue or PR as relevant to WG Structured Logging. label Feb 15, 2023
@pravarag
Copy link
Contributor Author

/wg structured-logging

@pravarag: ping - do you intend to finish this PR?

Hey sorry, been caught up in few other tasks I missed this one. I'll work on finishing it soon now :)

Copy link
Contributor

@pohly pohly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also remove the exception from

-contextual k8s.io/kubernetes/pkg/controller/podgc/.*

@mengjiao-liu
Copy link
Member

/sig instrumentation

Are you still working on this?

@k8s-ci-robot k8s-ci-robot added the sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. label Jul 5, 2023
@pravarag
Copy link
Contributor Author

pravarag commented Jul 5, 2023

/sig instrumentation

Are you still working on this?

Hi, I've been working on fixing this since the past week. Will push the changes soon

@pohly
Copy link
Contributor

pohly commented Jul 11, 2023

@pravarag: myself and the approver for these kind of PRs are only available two more days. If you can't finish the PR now, please say so and let someone else finish it.

@pravarag
Copy link
Contributor Author

@pravarag: myself and the approver for these kind of PRs are only available two more days. If you can't finish the PR now, please say so and let someone else finish it.

Hi @pohly, apologies for delaying work on this PR. As I'm stuck in some other work, happy for anyone else to finish this. Kindly assign someone else who might be interested.

@pohly
Copy link
Contributor

pohly commented Jul 12, 2023

/close

Replaced by #119250

@k8s-ci-robot
Copy link
Contributor

@pohly: Closed this PR.

In response to this:

/close

Replaced by #119250

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. wg/structured-logging Categorizes an issue or PR as relevant to WG Structured Logging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants