Skip to content

Commit

Permalink
test: allow overriding hcloud test client endpoint (#1077)
Browse files Browse the repository at this point in the history
Allows use to run the tests on a different endpoint.
  • Loading branch information
jooola authored Jan 23, 2025
1 parent c844932 commit b8df16a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/testsupport/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@ func CreateClient() (*hcloud.Client, error) {
opts := []hcloud.ClientOption{
hcloud.WithToken(os.Getenv("HCLOUD_TOKEN")),
}

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

return hcloud.NewClient(opts...), nil
}

0 comments on commit b8df16a

Please sign in to comment.