fix(operations): fail reconfigure fast when the component does not support parameters#10548
Open
weicao wants to merge 1 commit into
Open
fix(operations): fail reconfigure fast when the component does not support parameters#10548weicao wants to merge 1 commit into
weicao 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
Collaborator
|
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:
|
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.
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