From a950dbb4a5218104c05808236d591d0254ef5e5f Mon Sep 17 00:00:00 2001 From: Felix Breuer Date: Fri, 19 Dec 2025 12:24:59 +0100 Subject: [PATCH] allow setting stackit client target Signed-off-by: Felix Breuer --- pkg/provider/sdk_client.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/provider/sdk_client.go b/pkg/provider/sdk_client.go index 167cb05c..3adcb560 100644 --- a/pkg/provider/sdk_client.go +++ b/pkg/provider/sdk_client.go @@ -50,7 +50,8 @@ var ( // - More secure than static tokens (short-lived, rotating) func createIAASClient(serviceAccountKey string) (*iaas.APIClient, error) { // Configure SDK with custom base URL if provided (for testing with mock server) - baseURL := os.Getenv("STACKIT_API_ENDPOINT") + baseURL := os.Getenv("STACKIT_IAAS_ENDPOINT") + tokenEndpoint := os.Getenv("STACKIT_TOKEN_BASEURL") noAuth := os.Getenv("STACKIT_NO_AUTH") == "true" var opts []config.ConfigurationOption @@ -72,6 +73,10 @@ func createIAASClient(serviceAccountKey string) (*iaas.APIClient, error) { opts = append(opts, config.WithEndpoint(baseURL)) } + if tokenEndpoint != "" { + opts = append(opts, config.WithTokenEndpoint(tokenEndpoint)) + } + iaasClient, err := iaas.NewAPIClient(opts...) if err != nil { return nil, fmt.Errorf("failed to create STACKIT SDK API client: %w", err)