Skip to content

Change default onDelete and OnUpdate log level to debug#800

Merged
sudermanjr merged 1 commit intoFairwindsOps:masterfrom
regressEdo:feature/change-handler-errors-to-debug
Oct 16, 2025
Merged

Change default onDelete and OnUpdate log level to debug#800
sudermanjr merged 1 commit intoFairwindsOps:masterfrom
regressEdo:feature/change-handler-errors-to-debug

Conversation

@regressEdo
Copy link
Copy Markdown
Contributor

This PR fixes #799

Checklist

  • I have signed the CLA
  • I have updated/added any relevant documentation

Description

What's the goal of this PR?

The main goal is to reduce unnecessary error-level logging for expected but non-critical conditions in the event handlers. Currently, when OnUpdate or onDelete receive an unexpected object type or resource type, they log at the error level, which are not necessarily errors.

By lowering the log level, we make logs less noisy and avoid false alarms in monitoring systems that watch for error-level logs.

What changes did you make?

Changed log statements for unknown object types in OnUpdate from klog.Errorf to klog.V(2).Infof.
Changed log statements for unknown resource types in onDelete from klog.Errorf to klog.V(2).Infof.
These log messages are now classified as verbose info logs instead of errors, reflecting their actual severity.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Oct 16, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Member

@sudermanjr sudermanjr left a comment

Choose a reason for hiding this comment

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

Can you please remove all the unrelated changes in this diff?

@sudermanjr sudermanjr dismissed their stale review October 16, 2025 13:54

Wrong Button

@regressEdo
Copy link
Copy Markdown
Contributor Author

Can you please remove all the unrelated changes in this diff?

Alright sure, the linting was requested in the MR description but I could not run it properly due to some outdated package so I assumed a fix there would have helped.

@sudermanjr
Copy link
Copy Markdown
Member

Can you please remove all the unrelated changes in this diff?

Alright sure, the linting was requested in the MR description but I could not run it properly due to some outdated package so I assumed a fix there would have helped.

Yeah, that should be removed from the instructions apparently. We control a lot of stuff outside this repo

@regressEdo regressEdo force-pushed the feature/change-handler-errors-to-debug branch from 32b1b94 to 38b12a0 Compare October 16, 2025 14:03
@regressEdo regressEdo requested a review from sudermanjr October 16, 2025 14:36
@sudermanjr sudermanjr merged commit fd725f8 into FairwindsOps:master Oct 16, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error logs are flooded of Object has unknown type of <nil> even at lower verbosity

3 participants