Skip to content

Commit

Permalink
Merge pull request kubernetes#6740 from hetznercloud/hetzner-missing-…
Browse files Browse the repository at this point in the history
…hostname-label

fix(hetzner): hostname label is not considered
  • Loading branch information
k8s-ci-robot committed Apr 23, 2024
2 parents f000ae4 + c2216e2 commit 70c0ce9
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 70c0ce9

Please sign in to comment.