Skip to content

New machine should not move to the pending state if node label is missing#1070

Merged
gardener-prow[bot] merged 3 commits intogardener:masterfrom
aaronfern:pending_node_label
Feb 17, 2026
Merged

New machine should not move to the pending state if node label is missing#1070
gardener-prow[bot] merged 3 commits intogardener:masterfrom
aaronfern:pending_node_label

Conversation

@aaronfern
Copy link
Member

What this PR does / why we need it:
We recently ran into a bug where a machine was stuck in the Pending state while its corresponding node had already joined the cluster.
The reason for this was that the node name label on the machine had not yet been populated.
This can occur due to the an oversight in the machine creation flow where a newly created machine is moved to the Pending state after it's underlying node (or VM) has been created and initialised. The machine creation flow makes a best effort attempt to populate they node label, but it does not requeue the machine if it could not.
The reason we do not want machines to move to the Pending state in this case is that when a machine is in this state, it is not allowed to reenter the machine creation flow since we are just waiting for the node to join the k8s cluster. This causes an issue as the node name label is only updated by the machine creation flow and the machine deletion flow, leading to machines being stuck in this state indefinitely

These kind of bugs can surface when a CSP is not able to provide a node name on time. The machine creation flow in turn moved the machine to the Pending state after initialising the node (VM) and this machine is stuck

This PR enhances the machine creation flow to not allow newly created machines to proceed to the Pending phase when the NodeName and ProviderID are not available.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

newly created machines not moved to `Pending` state without valid node name and providerID from provider

@aaronfern aaronfern requested a review from a team as a code owner February 16, 2026 16:52
@gardener-prow gardener-prow bot added do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 16, 2026
@aaronfern aaronfern added the kind/bug Bug label Feb 16, 2026
@gardener-prow gardener-prow bot removed the do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label Feb 16, 2026
@r4mek
Copy link
Contributor

r4mek commented Feb 17, 2026

Other than that code changes seem fine. Should handle the case.

Copy link
Member

@takoverflow takoverflow left a comment

Choose a reason for hiding this comment

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

Thanks for the fix, LGTM!

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Feb 17, 2026
@gardener-prow
Copy link

gardener-prow bot commented Feb 17, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: takoverflow

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

@gardener-prow
Copy link

gardener-prow bot commented Feb 17, 2026

LGTM label has been added.

DetailsGit tree hash: aa1ba4d084c5a3462a5b56027cd4cb0951f4fdbf

@gardener-prow gardener-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 17, 2026
@takoverflow
Copy link
Member

/cherry-pick rel-v0.61

@gardener-ci-robot
Copy link

@takoverflow: once the present PR merges, I will cherry-pick it on top of rel-v0.61 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick rel-v0.61

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.

@takoverflow takoverflow removed their assignment Feb 17, 2026
@gardener-prow gardener-prow bot merged commit 59f57d5 into gardener:master Feb 17, 2026
13 checks passed
@gardener-ci-robot
Copy link

@takoverflow: new pull request created: #1072

Details

In response to this:

/cherry-pick rel-v0.61

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. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/bug Bug lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants