Skip to content

Ignore CAPI Machine failures resolved by modern True - #2310

Merged
nadaverell merged 1 commit into
mainfrom
fix/capi-condition-selection
Oct 27, 2026
Merged

nadaverell merged 1 commit into
mainfrom
fix/capi-condition-selection

Conversation

@nadaverell

@nadaverell nadaverell commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

A Cluster API Machine can carry modern NodeHealthy=True while its deprecated same-named condition still says False. Radar can raise a failure or show obsolete failure detail even though the modern observation establishes recovery.

A small Machine-local reader rejects a deprecated False failure when the modern same-named observation is True. It reuses existing condition readers and object-order selection. All four Machine reads use it, including the Ready fallback and condition details attached to Failed/stuck phase diagnostics. Expected progress stays selected so this cleanup cannot expose a new warning behind a formerly quiet wait. Modern False keeps its reason, message, transition time and severity; phase-based failures retain priority.

Unknown does not establish recovery and keeps the deprecated failure eligible. In particular, a Machine in Provisioned with a providerID but no joined node still reports its existing NodeProvisioning Issue. This deliberately preserves uncertain-state diagnostics instead of adding a new join timeout or silently clearing a stuck Machine. The existing WaitingForNodeRef noise is not addressed here.

Legacy-only and direct v1beta2 Machines retain existing interpretation. Progress filters, generation gates, severity, grace periods, namespace access and raw resource responses are unchanged. Cluster, MachineDeployment, KubeadmControlPlane and MachineHealthCheck are untouched. Renamed conditions such as BootstrapReady/BootstrapConfigReady are not mapped. No endpoint, frontend or public-library API changes.

Validation:

  • Focused Machine/source tests pass, including modern True/False/Unknown, real-shaped legacy Ready summaries, a one-hour-old Provisioned/no-node control, authoritative Ready failure, legacy progress, order/immutability and Failed/stuck details.
  • Complete internal/k8s and internal/issues suites passed in current-head CI, along with the separate server suite.
  • The full frontend/type-check → embed → Go build passed in current-head Settings CI. Before/after HTTP verification passed for both bridged v1beta1 and direct v1beta2 shapes (36 requests). The final progress-preservation branch has an additional focused detector regression.
  • Read-only EKS discovery found no CAPI CRDs. No natural CAPI/cloud reconciliation is claimed, and no cluster resources were created.
  • Focused product review supports this scope. Visual-test skipped: backend-only reader behavior, no rendered UI change.

All final-head build/test CI jobs passed at 538cf1319a. This PR targets main and changes only the three CAPI files.

@nadaverell
nadaverell requested a review from hisco as a code owner October 25, 2026 18:16
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Ignore resolved deprecated CAPI Machine condition failures

🐞 Bug fix 🧊 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

â€Ē Suppress deprecated Machine failures when the same-named modern condition is True, without
 changing phase priority.
â€Ē Preserve uncertain-state diagnostics and expected-progress filtering across Machine condition
 reads.
â€Ē Add regression coverage and document the Machine-specific selection rule.
Diagram

graph TD
  Cache["CAPI Machine"] --> Phase{"Phase failure?"} -->|No| Reader["False-condition reader"] -->|Candidate| Modern{"Modern True?"} -->|Yes| Progress{"Expected progress?"} -->|Yes| Detection["Selected detection"]
  Phase -->|Yes| Detection
  Modern -->|No| Detection
  Progress -->|No, retry| Reader
  Reader -->|None| Quiet["No condition detection"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Normalize conditions before shared readers
  • ➕ Could give other consumers a single effective condition view.
  • ➖ Broadens behavior beyond Machine detection and risks changing other CAPI kinds or generic issue handling.

Recommendation: Keep the Machine-local reader. It addresses conflicting condition sources at the affected detector without changing shared reader semantics or raw resources; broader normalization would need a separate cross-consumer design.

Files changed (3) +199 / -4

Bug fix (1) +23 / -4
detect_capi.goSelect unresolved failures for all Machine condition reads +23/-4

Select unresolved failures for all Machine condition reads

â€Ē Adds a Machine-local wrapper around existing condition readers that skips a deprecated False when a same-named modern condition is True, except when the selected reason denotes expected progress. Applies it to condition detection, Ready fallback, and Failed/stuck phase details while leaving other CAPI kinds unchanged.

internal/k8s/detect_capi.go

Tests (1) +174 / -0
detect_capi_authority_test.goCover modern and deprecated Machine condition conflicts +174/-0

Cover modern and deprecated Machine condition conflicts

â€Ē Adds detector and reader tests for True, False, Unknown, missing modern types, progress selection, Ready fallback, and Failed/stuck phase details. Also checks source order, namespace scope, direct v1beta2 behavior, and input immutability.

internal/k8s/detect_capi_authority_test.go

Documentation (1) +2 / -0
integrations.mdDocument Machine condition-source authority +2/-0

Document Machine condition-source authority

â€Ē Explains when modern True resolves a deprecated failure, why Unknown does not, and how progress and phase-based detections retain their behavior. Delimits the rule to Machines and same-named conditions.

docs/integrations.md

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
ðŸ’Ą Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 538cf13 ⚖ïļ Balanced

Results up to commit dafd7e9


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@nadaverell
nadaverell force-pushed the fix/capi-condition-selection branch from dafd7e9 to 41f4240 Compare October 26, 2026 00:30
@nadaverell nadaverell changed the title Keep actionable CAPI failures after in-progress conditions Use authoritative CAPI conditions without masking independent failures Oct 26, 2026
@nadaverell
nadaverell marked this pull request as draft October 26, 2026 01:01
@nadaverell nadaverell changed the title Use authoritative CAPI conditions without masking independent failures Respect authoritative CAPI Machine conditions Oct 26, 2026
@nadaverell
nadaverell force-pushed the fix/capi-condition-selection branch from 41f4240 to 9222b5b Compare October 26, 2026 17:53
@nadaverell nadaverell changed the title Respect authoritative CAPI Machine conditions Ignore CAPI Machine failures resolved by modern True Oct 26, 2026
@nadaverell
nadaverell force-pushed the fix/capi-condition-selection branch 3 times, most recently from a3d9600 to 75f00ca Compare October 27, 2026 00:10
@nadaverell
nadaverell force-pushed the fix/capi-condition-selection branch from 75f00ca to 538cf13 Compare October 27, 2026 00:11
@nadaverell
nadaverell marked this pull request as ready for review October 27, 2026 00:12
@cursor

cursor Bot commented Oct 27, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 538cf13

@nadaverell
nadaverell merged commit 335557d into main Oct 27, 2026
11 checks passed
@nadaverell
nadaverell deleted the fix/capi-condition-selection branch October 27, 2026 00:29
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.

1 participant