Skip to content

Conversation

jcpowermac
Copy link
Contributor

Manual cherry-pick of #3576

This commit sets failureDomain string defaulting to machine.Spec.FailureDomain. If failureDomain
is an empty string then vsphereMachine.Spec.FailureDomain is checked for nil, if defined failureDomain is set to vsphereMachine.Spec.FailureDomain.

This resolves an issue where virtual machines are not placed within vm-host groups in a timely
manner causing misplacement in the topology.

@k8s-ci-robot k8s-ci-robot added this to the v1.13 milestone Aug 21, 2025
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 21, 2025
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 21, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @jcpowermac. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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. Regular contributors should join the org to skip this step.

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.

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.

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 21, 2025
@chrischdi
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 21, 2025
@chrischdi
Copy link
Member

/ok-to-test

if failureDomain != "" {
vsphereDeploymentZone := &infrav1.VSphereDeploymentZone{}
if err := r.Client.Get(ctx, apitypes.NamespacedName{Name: *failureDomain}, vsphereDeploymentZone); err != nil {
return reconcile.Result{}, errors.Wrapf(err, "failed to get VSphereDeploymentZone %s", *failureDomain)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return reconcile.Result{}, errors.Wrapf(err, "failed to get VSphereDeploymentZone %s", *failureDomain)
return reconcile.Result{}, errors.Wrapf(err, "failed to get VSphereDeploymentZone %s", failureDomain)

return ctrl.Result{}, err
}

failureDomain := machine.Spec.FailureDomain
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
failureDomain := machine.Spec.FailureDomain
failureDomain := ptr.Deref(machine.Spec.FailureDomain, "")

… to vspheremachine's .spec.failureDomain if not defined

This commit sets failureDomain string defaulting to
`machine.Spec.FailureDomain`. If failureDomain
is an empty string then `vsphereMachine.Spec.FailureDomain` is
checked for nil, if defined `failureDomain` is set
to `vsphereMachine.Spec.FailureDomain`.

This resolves an issue where virtual machines are not placed
within vm-host groups in a timely
manner causing misplacement in the topology.
@jcpowermac jcpowermac force-pushed the cp-to-113-fix-fd-race branch from 4ba6045 to c183af6 Compare August 21, 2025 12:44
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 21, 2025
Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 21, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: abf773c73052800c5afa295673d3f65e675cabc9

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chrischdi

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 21, 2025
@chrischdi
Copy link
Member

/cherry-pick release-1.12

@k8s-infra-cherrypick-robot

@chrischdi: once the present PR merges, I will cherry-pick it on top of release-1.12 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.12

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.

@k8s-ci-robot k8s-ci-robot merged commit 97ffe5e into kubernetes-sigs:release-1.13 Aug 21, 2025
17 checks passed
@k8s-infra-cherrypick-robot

@chrischdi: new pull request created: #3590

In response to this:

/cherry-pick release-1.12

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.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants