Skip to content

Commit 92847eb

Browse files
authored
allow setting stackit client target (#76)
Signed-off-by: Felix Breuer <f.breuer94@gmail.com>
1 parent bd425db commit 92847eb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/provider/sdk_client.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ var (
5050
// - More secure than static tokens (short-lived, rotating)
5151
func createIAASClient(serviceAccountKey string) (*iaas.APIClient, error) {
5252
// Configure SDK with custom base URL if provided (for testing with mock server)
53-
baseURL := os.Getenv("STACKIT_API_ENDPOINT")
53+
baseURL := os.Getenv("STACKIT_IAAS_ENDPOINT")
54+
tokenEndpoint := os.Getenv("STACKIT_TOKEN_BASEURL")
5455
noAuth := os.Getenv("STACKIT_NO_AUTH") == "true"
5556

5657
var opts []config.ConfigurationOption
@@ -72,6 +73,10 @@ func createIAASClient(serviceAccountKey string) (*iaas.APIClient, error) {
7273
opts = append(opts, config.WithEndpoint(baseURL))
7374
}
7475

76+
if tokenEndpoint != "" {
77+
opts = append(opts, config.WithTokenEndpoint(tokenEndpoint))
78+
}
79+
7580
iaasClient, err := iaas.NewAPIClient(opts...)
7681
if err != nil {
7782
return nil, fmt.Errorf("failed to create STACKIT SDK API client: %w", err)

0 commit comments

Comments
 (0)