← Back to Pull requests

✨ Report status.failureDomain on Metal3Machine #3922

Merged
shibaPuppy merged 8 files (202 lines) on Dec 02, 2026 12:48 UTC
View on GitHub
shibaPuppy shibaPuppy commented on Nov 30, 2026 08:56 UTC
Author

What this PR does / why we need it:

Cluster API v1beta2 populates Machine.status.failureDomain only from the
infrastructure machine's status.failureDomain. Metal3Machine exposed the
failure domain in spec alone, so even after #3589 placed a machine on a
host in its assigned failure domain, the Machine column stayed empty.

This PR adds status.failureDomain to Metal3Machine and fills it in
updateMachineStatus from the infrastructure.cluster.x-k8s.io/failure-domain
label of the associated BareMetalHost.

Behavior:

  • The value is read from the host label on every update, so it follows

  • label changes. A label change on a consumed host triggers a reconcile
    through the existing BareMetalHost watch.
  • It is empty when the host carries no label, and it is cleared in

  • Update() when the host referenced by the annotation can no longer be
    found, so a stale value is not reported until the next association.
  • It can differ from spec.failureDomain when the machine fell back to a

  • host outside its assigned failure domain (allowFailureDomainFallback).
    spec records the assignment, status records the host.
  • Cluster API copies it to Machine.status.failureDomain once the

  • Metal3Machine is provisioned and spec.providerID is set, the same
    condition it uses for addresses.

    The field does not exist in v1beta1, so the conversion restores it from the
    annotation like the other v1beta2-only fields. No Metal3Machine printcolumn
    is added since the Machine object already shows it.

    Tests:

  • Unit tests for updateMachineStatus and Update(): label reported,

  • label differs from spec, unlabeled host clears the value, missing host
    clears the value.
  • The failure domain e2e now checks status.failureDomain against the host

  • label and verifies Machine.status.failureDomain on every control plane
    machine.

    Fixes #3896

    Checklist:

  • Documentation has been updated, if necessary.

  • Unit tests have been added, if necessary.

  • E2E tests have been added, if necessary.

  • Integration tests have been added, if necessary.
  • Diff: 202 lines (+194 / -8) across 8 files Reviewer: adilGhaffarDev Review duration: 3112m
    All Vouch review confidence checks passed
    Residual risk 0.08 = Change Risk (0.45) × (1 − Review Confidence (0.82)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 202 lines diff across 8 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.74 · 5 substantive comment(s)
    0.74
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    82%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.318
    Real PR Conversation Timeline
    9 items
    metal3-io-bot metal3-io-bot commented on Nov 30, 2026 08:56 UTC
    Bot

    Hi @shibaPuppy. Thanks for your PR.

    I'm waiting for a metal3-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

    >[!TIP]
    >We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

    Once the patch is verified, the new status will be reflected by the ok-to-test label.

    I understand the commands that are listed here.

    <details>

    Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
    </details>

    adilGhaffarDev adilGhaffarDev approved these changes on Dec 01, 2026 07:23 UTC
    Approved Reviewer

    /approve

    metal3-io-bot metal3-io-bot commented on Dec 01, 2026 07:23 UTC
    Bot

    [APPROVALNOTIFIER] This PR is APPROVED

    This pull-request has been approved by: <a href="https://github.com/metal3-io/cluster-api-provider-metal3/pull/3922#pullrequestreview-6126755974" title="Approved">adilGhaffarDev</a>

    The full list of commands accepted by this bot can be found here.

    The pull request process is described here

    <details >
    Needs approval from an approver in each of these files:

  • ~~OWNERS~~ [adilGhaffarDev]
  • Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment
    </details>
    <!-- META={"approvers":[]} -->

    adilGhaffarDev adilGhaffarDev commented on Dec 01, 2026 07:24 UTC
    Contributor

    /test metal3-centos-e2e-integration-test-main metal3-ubuntu-e2e-integration-test-main

    adilGhaffarDev adilGhaffarDev commented on Dec 01, 2026 07:26 UTC
    Contributor

    /test ?

    adilGhaffarDev adilGhaffarDev commented on Dec 01, 2026 07:26 UTC
    Contributor

    /test metal3-centos-e2e-feature-test-main-features

    adilGhaffarDev adilGhaffarDev commented on Dec 01, 2026 08:04 UTC
    Contributor

    /ok-to-test

    Sunnatillo Sunnatillo commented on Dec 02, 2026 12:42 UTC
    Reviewer

    /lgtm

    Assignees
    shibaPuppy shibaPuppy
    Labels
    risk: low confidence: 82.1% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45% (MEDIUM) · Higher = larger blast radius
    45%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 82.1% · Lower = rushed or shallow review
    82.1%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 8% · Safe to merge
    8%