fix: match control-plane nodes by their modern label

Kubernetes 1.20 deprecated the node-role.kubernetes.io/master label and replaced it with node-role.kubernetes.io/control-plane, and 1.24 dropped the legacy label entirely. The scheduler-k3s:cluster:add join path still filtered control-plane nodes with master=true, so on any k3s release built from Kubernetes 1.24+ the lookup matched zero nodes and aborted with "no nodes found in the cluster" before the worker could join.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-05-31 16:24:23 -04:00
1 parent 213d89b1e4
commit 099cf10e98
3 files changed
+121 -3

No files matched your search

+2 -2
View File
@@ -85,7 +85,7 @@ func (e *NilResponseError) Error() string {
// KubernetesClient is a wrapper around the Kubernetes client
type KubernetesClient struct {
// Client is the Kubernetes client
Client kubernetes.Clientset
Client kubernetes.Interface
// DynamicClient is the Kubernetes dynamic client
DynamicClient dynamic.Interface
@@ -133,7 +133,7 @@ func NewKubernetesClient() (KubernetesClient, error) {
}
return KubernetesClient{
Client: *client,
Client: client,
DynamicClient: dynamicClient,
KubeConfigPath: kubeconfigPath,
RestConfig: *restConf,