✨ Report status.failureDomain on Metal3Machine #3922
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>
/approve
[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:
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":[]} -->
/test metal3-centos-e2e-integration-test-main metal3-ubuntu-e2e-integration-test-main
/test ?
/test metal3-centos-e2e-feature-test-main-features
/ok-to-test
/lgtm
adilGhaffarDev
shibaPuppy
What this PR does / why we need it:
Cluster API v1beta2 populates
Machine.status.failureDomainonly from theinfrastructure machine's
status.failureDomain. Metal3Machine exposed thefailure domain in
specalone, so even after #3589 placed a machine on ahost in its assigned failure domain, the Machine column stayed empty.
This PR adds
status.failureDomainto Metal3Machine and fills it inupdateMachineStatusfrom theinfrastructure.cluster.x-k8s.io/failure-domainlabel of the associated BareMetalHost.
Behavior:
label changes. A label change on a consumed host triggers a reconcile
through the existing BareMetalHost watch.
Update()when the host referenced by the annotation can no longer befound, so a stale value is not reported until the next association.
spec.failureDomainwhen the machine fell back to ahost outside its assigned failure domain (
allowFailureDomainFallback).specrecords the assignment,statusrecords the host.Machine.status.failureDomainonce theMetal3Machine is provisioned and
spec.providerIDis set, the samecondition 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:
updateMachineStatusandUpdate(): label reported,label differs from spec, unlabeled host clears the value, missing host
clears the value.
status.failureDomainagainst the hostlabel and verifies
Machine.status.failureDomainon every control planemachine.
Fixes #3896
Checklist: