Skip to content

Commit

Permalink
Merge pull request #7285 from Altinity/master
Browse files Browse the repository at this point in the history
Support custom HCLOUD_ENDPOINT in cluster-autoscaler Hetzner manager
  • Loading branch information
k8s-ci-robot authored Sep 16, 2024
2 parents 59aba2b + 143eea4 commit 2aba7bd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cluster-autoscaler/cloudprovider/hetzner/hetzner_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,20 @@ func newManager() (*hetznerManager, error) {
return nil, errors.New("`HCLOUD_TOKEN` is not specified")
}

client := hcloud.NewClient(
opts := []hcloud.ClientOption{
hcloud.WithToken(token),
hcloud.WithHTTPClient(httpClient),
hcloud.WithApplication("cluster-autoscaler", version.ClusterAutoscalerVersion),
hcloud.WithPollBackoffFunc(hcloud.ExponentialBackoff(2, 500*time.Millisecond)),
hcloud.WithDebugWriter(&debugWriter{}),
)
}

endpoint := os.Getenv("HCLOUD_ENDPOINT")
if endpoint != "" {
opts = append(opts, hcloud.WithEndpoint(endpoint))
}

client := hcloud.NewClient(opts...)

ctx := context.Background()
var err error
Expand Down

0 comments on commit 2aba7bd

Please sign in to comment.