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

Switch extension controller to logr and streamline/cleanup logs #6332

Merged
merged 9 commits into from
Jul 15, 2022

Conversation

rfranzke
Copy link
Member

@rfranzke rfranzke commented Jul 14, 2022

How to categorize this PR?

/area dev-productivity logging
/kind enhancement

What this PR does / why we need it:
This PR

  • streamlines the log level when an object is no longer found
  • streamlines the finalizer handling (logs + errors)
  • uses logf.FromContext(ctx) in all controllers in ./extensions/...
  • drops usage of global logf.Log in favor of local reconciler loggers

Which issue(s) this PR fixes:
Part of #4251

Release note:

All `Actuator` interfaces for extension controllers have been extended and now receive a `logr.Logger` passed from the reconciler with the proper context of the reconciled object.

@gardener-prow gardener-prow bot added the area/dev-productivity Developer productivity related (how to improve development) label Jul 14, 2022
@gardener-prow
Copy link
Contributor

gardener-prow bot commented Jul 14, 2022

@rfranzke: The label(s) kind/logging cannot be applied, because the repository doesn't have them.

In response to this:

How to categorize this PR?

/area dev-productivity
/kind logging

What this PR does / why we need it:
This PR

  • streamlines the log level when an object is no longer found
  • streamlines the finalizer handling (logs + errors)
  • uses logf.FromContext(ctx) in all controllers in ./extensions/...
  • drops usage of global logf.Log in favor of local reconciler loggers

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

NONE

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.

@gardener-prow gardener-prow bot added cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Jul 14, 2022
@gardener-prow gardener-prow bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 14, 2022
@rfranzke rfranzke added kind/enhancement Enhancement, improvement, extension area/logging Logging related labels Jul 14, 2022
@gardener-prow gardener-prow bot removed the do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label Jul 14, 2022
@plkokanov plkokanov self-assigned this Jul 14, 2022
Copy link
Contributor

@plkokanov plkokanov left a comment

Choose a reason for hiding this comment

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

Halfway through the commits.

extensions/pkg/controller/extension/reconciler.go Outdated Show resolved Hide resolved
extensions/pkg/controller/network/reconciler.go Outdated Show resolved Hide resolved
extensions/pkg/controller/worker/controller.go Outdated Show resolved Hide resolved
@timebertt
Copy link
Member

/assign

Copy link
Member

@timebertt timebertt left a comment

Choose a reason for hiding this comment

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

Wow, this PR was a lot of effort! Nice work, highly appreciated ❤️
Special thanks for the harmonization around finalizer handling.

Can you add a breaking release note for extensions about the added log parameters in the library?

extensions/pkg/controller/backupentry/reconciler.go Outdated Show resolved Hide resolved
pkg/controllerutils/finalizers.go Outdated Show resolved Hide resolved
pkg/controllerutils/finalizers.go Outdated Show resolved Hide resolved
Copy link
Member

@timebertt timebertt left a comment

Choose a reason for hiding this comment

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

Sweet!
/lgtm

@gardener-prow gardener-prow bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 15, 2022
Copy link
Contributor

@plkokanov plkokanov left a comment

Choose a reason for hiding this comment

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

Amazing PR :)
/lgtm

@gardener-prow gardener-prow bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 15, 2022
@gardener-prow gardener-prow bot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 15, 2022
Copy link
Member

@timebertt timebertt left a comment

Choose a reason for hiding this comment

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

/lgtm

@gardener-prow
Copy link
Contributor

gardener-prow bot commented Jul 15, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: plkokanov, timebertt

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:
  • OWNERS [plkokanov,timebertt]

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

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jul 15, 2022
@gardener-prow
Copy link
Contributor

gardener-prow bot commented Jul 15, 2022

@rfranzke: The following test 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-gardener-apidiff ae5efd4 link false /test pull-gardener-apidiff

Full PR test history. Your PR dashboard. Command help for this repository.

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.

@gardener-prow gardener-prow bot merged commit cffdb9f into gardener:master Jul 15, 2022
@rfranzke rfranzke deleted the refactor/logs branch July 15, 2022 07:59
krgostev pushed a commit to krgostev/gardener that referenced this pull request Sep 8, 2022
* 'master' of github.com:gardener/gardener: (51 commits)
  Switch extension controller to `logr` and streamline/cleanup logs (gardener#6332)
  Switch `./test/...` packages to `logr` and drop `github.com/sirupsen/logrus` dependency (gardener#6316)
  Only check shoot conditions during hibernation integration test (gardener#6325)
  Add dashboard for monitoring conntrack race failures. (gardener#6329)
  Reconcile quota before rbac (gardener#6326)
  Update istio to v1.14.1 (gardener#6271)
  Update gardenlet's base image to alpine:3.16.0 (gardener#6321)
  Update envoy proxy to v1.21.4 (gardener#6320)
  Deploy the metrics server to the kind cluster (gardener#6301)
  Fix tools download for aarch64 (arm64) (gardener#6314)
  update with latest CA releases (gardener#6295)
  Add missing unit tests for the predicates provided by the extensions library (gardener#6249)
  [GEP-19] Monitoring Stack - Migrating to the `prometheus-operator` (gardener#6151)
  Revert "Recreate DWD deployment if needed" (gardener#6307)
  Update to golang 1.18.4 (gardener#6300)
  Cleaned up imports in vpn-seed-server (gardener#6315)
  Prepare next Dev Cycle v1.52.0-dev
  Release v1.51.0
  Add pre/post reconciliation/deletion hooks for the Worker resource (gardener#6290)
  Update the supported values in the usage text of the `--leader-election-resource-lock` flag (gardener#6304)
  ...
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. area/dev-productivity Developer productivity related (how to improve development) area/logging Logging related cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants