fix(operations): fail reconfigure fast when the component does not support parameters - #10548
fix(operations): fail reconfigure fast when the component does not support parameters#10548weicao wants to merge 1 commit into
Conversation
…pport parameters A Reconfigure OpsRequest targeting a component whose ComponentParameter CR does not exist retried forever on a bare NotFound error, on both the Action and ReconcileAction paths, because only fatal errors transition an OpsRequest to Failed. Classify the NotFound with the same predicate the componentdrivenparameter controller uses to decide whether it will ever create the ComponentParameter (ComponentDefinition config templates resolving to valid ParametersDefinitions): if the component provably does not support parameters, fail fast with a clear message; otherwise keep the existing retry behavior to tolerate creation lag. Fixes #10545
|
Auto Cherry-pick Instructions CLA Recheck Instructions |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10548 +/- ##
==========================================
+ Coverage 63.68% 63.74% +0.05%
==========================================
Files 519 519
Lines 62852 62880 +28
==========================================
+ Hits 40027 40080 +53
+ Misses 19202 19182 -20
+ Partials 3623 3618 -5
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:
|
| return notFoundErr | ||
| } | ||
| } | ||
| return intctrlutil.NewErrorf(intctrlutil.ErrorTypeFatal, |
There was a problem hiding this comment.
This fatal classification violates reconcile semantics. ResolveCmpdParametersDefs returning no match describes the dependencies visible in this reconciliation; it is not a stable API fact that the component will never support parameters. The component-driven parameter controller explicitly watches ParametersDefinition and can create the missing ComponentParameter when a matching PD is created or becomes Available later. With this branch, a Reconfigure submitted before that event becomes terminally Failed before the system gets a chance to converge. Without an authoritative API-level terminal capability such as "parameters unsupported", one reconcile pass cannot infer "never" from currently absent dependencies.
Problem
A Reconfigure OpsRequest targeting a component whose ComponentParameter CR does not exist retries forever on a bare NotFound error — on both the Action and ReconcileAction paths — because only fatal errors transition an OpsRequest to Failed. For a component whose ComponentDefinition declares no parameter support, the CR will never appear, so the ops hangs indefinitely instead of telling the user the component does not support reconfigure.
Root cause
pkg/operations/reconfigure.goreturns the ComponentParameter Get error as-is; the framework treats plain errors as retryable (endless requeue), while the referenced object is deterministically absent.Change
Classify the NotFound with the same predicate the componentdrivenparameter controller uses to decide whether it will ever create the ComponentParameter (ComponentDefinition config templates resolving to valid ParametersDefinitions):
FatalError("component ... does not support reconfigure") → ops fails fast with a clear message;What this does NOT change
Tests
Regression specs cover both paths and both discriminator branches: unsupported component → Fatal/Failed phase; supporting component with missing CR → still retries. RED verified by restoring origin/main's reconfigure.go with the new tests kept (TestAPIs FAIL), GREEN with the fix (
go test ./pkg/operations/...all ok; vet/gofmt clean).Fixes #10545