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 gardenlet to logr (4) #6265

Merged
merged 7 commits into from
Jul 11, 2022

Conversation

rfranzke
Copy link
Member

@rfranzke rfranzke commented Jul 5, 2022

How to categorize this PR?

/area logging dev-productivity
/kind enhancement

What this PR does / why we need it:
Migrate gardenlet's BackupEntry controller to logr. Similar to #6259.

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

Release note:

NONE

@gardener-prow gardener-prow bot added area/logging Logging related area/dev-productivity Developer productivity related (how to improve development) kind/enhancement Enhancement, improvement, extension cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. labels Jul 5, 2022
@gardener-prow gardener-prow bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 5, 2022
Copy link
Member

@oliver-goetz oliver-goetz left a comment

Choose a reason for hiding this comment

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

two comments for clarification, otherwise lgtm

Copy link
Member

@oliver-goetz oliver-goetz 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 gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jul 6, 2022
rfranzke added a commit to rfranzke/gardener that referenced this pull request Jul 6, 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.

/lgtm from me as well

@gardener-prow gardener-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 8, 2022
@rfranzke
Copy link
Member Author

rfranzke commented Jul 8, 2022

/hold

@gardener-prow gardener-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 8, 2022
@timebertt
Copy link
Member

/assign

@timebertt timebertt added this to the v1.51 milestone Jul 11, 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.

Nits, rest looks good

if err := controllerutils.StrategicMergePatchAddFinalizers(ctx, gardenClient.Client(), backupEntry, gardencorev1beta1.GardenerName); err != nil {
backupEntryLogger.Errorf("could not add finalizer to BackupEntry: %+v", err)
return reconcile.Result{}, err
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
return reconcile.Result{}, err
return reconcile.Result{}, fmt.Errorf("could not add finalizer to BackupEntry: %w", err)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we have not done this in

log.Info("Adding finalizer")
if err := controllerutils.StrategicMergePatchAddFinalizers(ctx, gardenClient.Client(), backupBucket, gardencorev1beta1.GardenerName); err != nil {
return reconcile.Result{}, err
because there is this Adding finalizer log message above this call, hence if an error occurs it will be the next message which makes clear that it is because of trying to add the finalizer. However, I see that this is not consistent across the set of controllers. Should we add it anyways?

Copy link
Member

Choose a reason for hiding this comment

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

I see. We can do it as you prefer.
It would be desirable to clean this up for consistency somewhen though. Maybe it's a good idea to do it in a dedicated PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I add it to my notes and do it in the last PR which drops logrus. Do you want to have these custom error statements as suggested here or remove them everywhere (and rely on Adding finalzer` log)?

Copy link
Member

Choose a reason for hiding this comment

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

I tend towards expressive error messages. They make it very easy to pinpoint a given error statement.

@gardener-prow gardener-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 11, 2022
@timebertt
Copy link
Member

/hold cancel

@gardener-prow gardener-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 11, 2022
@gardener-prow
Copy link
Contributor

gardener-prow bot commented Jul 11, 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 c601382 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.

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.

Thanks!
/lgtm
/hold for @rfranzke's feedback on #6265 (comment)

@gardener-prow gardener-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 11, 2022
@gardener-prow
Copy link
Contributor

gardener-prow bot commented Jul 11, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: oliver-goetz, 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 11, 2022
@rfranzke
Copy link
Member Author

/hold cancel

@gardener-prow gardener-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 11, 2022
@gardener-prow gardener-prow bot merged commit 7a66aab into gardener:master Jul 11, 2022
@rfranzke rfranzke deleted the refactor/gardenlet-logs-4 branch July 11, 2022 17:20
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants