Skip to content

fix(operations): fail reconfigure fast when the component does not support parameters#10548

Open
weicao wants to merge 1 commit into
mainfrom
bugfix/reconfigure-ops-unsupported-component
Open

fix(operations): fail reconfigure fast when the component does not support parameters#10548
weicao wants to merge 1 commit into
mainfrom
bugfix/reconfigure-ops-unsupported-component

Conversation

@weicao

@weicao weicao commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

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.go returns 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):

  • component provably does not support parameters → FatalError ("component ... does not support reconfigure") → ops fails fast with a clear message;
  • support status unprovable or controller merely lagging → original NotFound is returned, existing retry behavior preserved (no over-tightening).

What this does NOT change

  • No validation-layer additions; classification happens at the two existing consumption points only.
  • The componentdrivenparameter controller and parameters rendering pipeline are untouched.

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

…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
@weicao weicao requested review from a team and wangyelei as code owners July 5, 2026 18:53
@github-actions github-actions Bot added the size/L Denotes a PR that changes 100-499 lines. label Jul 5, 2026
@apecloud-bot

Copy link
Copy Markdown
Collaborator

Auto Cherry-pick Instructions

Usage:
  - /nopick: Not auto cherry-pick when PR merged.
  - /pick: release-x.x [release-x.x]: Auto cherry-pick to the specified branch when PR merged.

Example:
  - /nopick
  - /pick release-1.1

CLA Recheck Instructions

Usage:
  - /recheck-cla: Trigger a re-check of CLA status for this pull request.
Example:
  - /recheck-cla

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.51724% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.74%. Comparing base (ecd604d) to head (b4de54a).

Files with missing lines Patch % Lines
pkg/operations/reconfigure.go 65.51% 7 Missing and 3 partials ⚠️
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     
Flag Coverage Δ
unittests 63.74% <65.51%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reconfigure OpsRequest on a component without parameter support hangs forever

2 participants