Skip to content

Commit

Permalink
Merge pull request #6751 from hetznercloud/hetzner-missing-hostname-l…
Browse files Browse the repository at this point in the history
…abels-1.30

[v1.30] fix(hetzner): hostname label is not considered
  • Loading branch information
k8s-ci-robot authored Apr 24, 2024
2 parents 2c2660a + f23d5b7 commit 9d69082
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cluster-autoscaler/cloudprovider/hetzner/hetzner_node_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -229,10 +228,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,
Expand Down

0 comments on commit 9d69082

Please sign in to comment.