fix(tektonconfig): stop logging requeue as error - #3881
Merged
Conversation
Motivation: On a fresh install, TektonConfig's PostReconcile step
polls dependent CRs (TektonDashboard, TektonAddon,
OpenShiftPipelinesAsCode) that are not ready yet. The extension's
PostReconcile hook signals this expected, transient condition by
returning the v1alpha1.REQUEUE_EVENT_AFTER sentinel, per this
repo's own convention that it means "retry later", not a failure.
ReconcileKind logged every such return at ERROR level with a full
stack trace ("Post-reconcile hook failed", error "requeue after:
10s"), repeating every ~10s until the dependency became ready,
flooding the operator's logs during a routine install.
Approach: Check for the v1alpha1.REQUEUE_EVENT_AFTER sentinel
before logging, matching the pattern already used elsewhere in
this file (e.g. the PreReconcile hook a few lines above) and
throughout the reconciler package (e.g. tektonpipeline,
tektontrigger, manualapprovalgate). When PostReconcile returns
this sentinel, log at Info level instead of Error. The returned
error value is unchanged in both branches, so the knative
controller's requeue/retry behavior is identical before and
after this change; only the log severity for this benign,
expected condition changes.
Validation: go build ./... and go vet
./pkg/reconciler/shared/tektonconfig/... pass with no issues;
gofmt -l on the changed file reports no formatting issues; go
test ./pkg/reconciler/shared/tektonconfig/... passes for all
subpackages (the top-level package has no pre-existing unit
test file for ReconcileKind to extend, and this is a
log-severity-only change with no behavioral difference to
assert against). golangci-lint could not be run in this
sandbox: `make lint-go` fails downloading the golangci-lint
binary from GitHub with a checksum verification error, a
sandbox/network restriction unrelated to this change.
Report: tektoncd#3125
Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3881 +/- ##
==========================================
- Coverage 26.13% 26.13% -0.01%
==========================================
Files 465 465
Lines 24930 24933 +3
==========================================
Hits 6516 6516
- Misses 17694 17697 +3
Partials 720 720
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
/approve |
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jkhelil The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Contributor
|
/lgtm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Fixed
TektonConfig'sPostReconcilestep logging every expected "not ready yet" retry at ERROR level with a full stack trace. On a fresh install, the extension'sPostReconcilehook polls dependent CRs (TektonDashboard,TektonAddon,OpenShiftPipelinesAsCode) that aren't ready yet, and signals this transient condition by returning thev1alpha1.REQUEUE_EVENT_AFTERsentinel — per this repo's convention that it means "retry later", not a failure.ReconcileKindwas logging every such return as an error ("Post-reconcile hook failed"), repeating every ~10s until the dependency became ready and flooding the operator's logs during a routine install.This change checks for the
v1alpha1.REQUEUE_EVENT_AFTERsentinel before logging, matching the pattern already used elsewhere in this file (e.g. thePreReconcilehook) and throughout the reconciler package (e.g.tektonpipeline,tektontrigger,manualapprovalgate). WhenPostReconcilereturns this sentinel, the log level is now Info instead of Error. The returned error value is unchanged in both branches, so requeue/retry behavior is identical before and after this change; only the log severity for this benign, expected condition changes.Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make test lintbefore submitting a PRSee the contribution guide for more details.
Release Notes
AI assistance: this change was drafted with Claude Code.
Fixes #3125