Skip to content

Commit

Permalink
fix(hetzner): unused draining node pool references deprecated server …
Browse files Browse the repository at this point in the history
…type

The `cx11` server type was deprecated on 2024-06-06 and will be removed
from the API on 2024-09-06. Once it is removed, the cluster-autoscaler
provider hetzner will not start anymore with the following error
message:

    Failed to get node infos for groups: failed to create resource list for node group draining-node-pool error: failed to get machine type cx11 info error: server type not found

As the node pool `draining-node-pool` is not being used anywhere, this
commit removes it and the hard coded reference to the deprecated server
type.
  • Loading branch information
apricote committed Aug 29, 2024
1 parent 7e8ec1b commit f5058b7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const (
providerIDPrefix = "hcloud://"
nodeGroupLabel = hcloudLabelNamespace + "/node-group"
hcloudLabelNamespace = "hcloud"
drainingNodePoolId = "draining-node-pool"
serverCreateTimeoutDefault = 5 * time.Minute
serverRegisterTimeout = 10 * time.Minute
defaultPodAmountsLimit = 110
Expand Down
15 changes: 0 additions & 15 deletions cluster-autoscaler/cloudprovider/hetzner/hetzner_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,6 @@ func newManager() (*hetznerManager, error) {
cachedServers: newServersCache(ctx, client),
}

m.nodeGroups[drainingNodePoolId] = &hetznerNodeGroup{
manager: m,
instanceType: "cx11",
region: "fsn1",
targetSize: 0,
maxSize: 0,
minSize: 0,
id: drainingNodePoolId,
}

return m, nil
}

Expand Down Expand Up @@ -200,11 +190,6 @@ func (m *hetznerManager) deleteServer(server *hcloud.Server) error {
return err
}

func (m *hetznerManager) addNodeToDrainingPool(node *apiv1.Node) (*hetznerNodeGroup, error) {
m.nodeGroups[drainingNodePoolId].targetSize += 1
return m.nodeGroups[drainingNodePoolId], nil
}

func (m *hetznerManager) validProviderID(providerID string) bool {
return strings.HasPrefix(providerID, providerIDPrefix)
}
Expand Down

0 comments on commit f5058b7

Please sign in to comment.