Skip to content

Commit 17105a0

Browse files
committed
Fix Autoscaling for worker nodes with invalid ProviderID
This change fixes a bug that arises when the user's cluster includes worker nodes not from Hetzner Cloud, such as a Hetzner Dedicated server or any server resource other than Hetzner. It also corrects the behavior when a server has been physically deleted from Hetzner Cloud. Signed-off-by: Maksim Paskal <paskal.maksim@gmail.com>
1 parent 59882e0 commit 17105a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cluster-autoscaler/cloudprovider/hetzner/hetzner_servers_cache.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package hetzner
1818

1919
import (
2020
"context"
21-
"errors"
2221
"strconv"
2322
"sync"
2423
"time"
@@ -136,7 +135,8 @@ func (m *serversCache) getServer(nodeIdOrName string) (*hcloud.Server, error) {
136135
}
137136
}
138137

139-
return nil, errors.New("server not found")
138+
// return nil if server not found
139+
return nil, nil
140140
}
141141

142142
func (m *serversCache) getServersByNodeGroupName(nodeGroup string) ([]*hcloud.Server, error) {

0 commit comments

Comments
 (0)