Skip to content

Use hostname instead of label to query node readiness#1041

Merged
kke merged 2 commits intok0sproject:mainfrom
gknw:get-specific-node-instead-of-label-filtering-#1040
Mar 10, 2026
Merged

Use hostname instead of label to query node readiness#1041
kke merged 2 commits intok0sproject:mainfrom
gknw:get-specific-node-instead-of-label-filtering-#1040

Conversation

@gknw
Copy link
Copy Markdown
Contributor

@gknw gknw commented Mar 5, 2026

This PR addresses #1040 by changing the node readiness check to query a node by its name (hostname) instead of using a label selector, avoiding scenarios where the kubelet identity lacks RBAC permissions to list nodes by label.

Changes:

Switch kubectl get node invocation from -l kubernetes.io/hostname=... to get node .
Update the JSON parsing struct and readiness condition traversal to match the single-Node JSON shape instead of a NodeList.

@kke kke changed the title Node label filtering is not working then running on worker-nodes Use hostname instead of label to query node readiness Mar 5, 2026
@kke kke requested a review from Copilot March 5, 2026 15:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses #1040 by changing the node readiness check to query a node by its name (hostname) instead of using a label selector, avoiding scenarios where the kubelet identity lacks RBAC permissions to list nodes by label.

Changes:

  • Switch kubectl get node invocation from -l kubernetes.io/hostname=... to get node <hostname>.
  • Update the JSON parsing struct and readiness condition traversal to match the single-Node JSON shape instead of a NodeList.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: gknw <64784493+gknw@users.noreply.github.com>
@gknw gknw force-pushed the get-specific-node-instead-of-label-filtering-#1040 branch from 65a3d3d to 5f9ff8f Compare March 5, 2026 16:36
@kke kke requested a review from Copilot March 9, 2026 07:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/node/statusfunc.go Outdated
Comment thread pkg/node/statusfunc.go Outdated
Comment thread pkg/node/statusfunc.go Outdated
Removed unnecessary node hostname lowercasing

Signed-off-by: gknw <64784493+gknw@users.noreply.github.com>
@kke kke merged commit 0e9d736 into k0sproject:main Mar 10, 2026
45 checks passed
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.

3 participants