diff --git a/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go b/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go index 179c92a5b23a..05153eb73c31 100644 --- a/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go +++ b/cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go @@ -19,13 +19,12 @@ package hetzner import ( "context" "fmt" + "maps" "math/rand" "strings" "sync" "time" - "maps" - apiv1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -224,10 +223,14 @@ func (n *hetznerNodeGroup) TemplateNodeInfo() (*schedulerframework.NodeInfo, err return nil, fmt.Errorf("failed to create resource list for node group %s error: %v", n.id, err) } + nodeName := newNodeName(n) + node := apiv1.Node{ ObjectMeta: metav1.ObjectMeta{ - Name: newNodeName(n), - Labels: map[string]string{}, + Name: nodeName, + Labels: map[string]string{ + apiv1.LabelHostname: nodeName, + }, }, Status: apiv1.NodeStatus{ Capacity: resourceList,