Skip to content

Commit

Permalink
Fix client creation
Browse files Browse the repository at this point in the history
  • Loading branch information
julienduchesne committed Feb 1, 2024
1 parent b654e03 commit eaeb08b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions internal/resources/cloud/resource_cloud_stack_api_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func testAccGrafanaAuthCheckKeys(stack *gcom.FormattedApiInstance, expectedKeys

response, err := c.APIKeys.GetAPIkeys(api_keys.NewGetAPIkeysParams())
if err != nil {
return err
return fmt.Errorf("failed to get API keys: %w", err)
}

var foundKeys []string
Expand Down Expand Up @@ -141,9 +141,12 @@ func createTemporaryStackGrafanaClient(ctx context.Context, cloudClient *gcom.AP
}

client := goapi.NewHTTPClientWithConfig(nil, &goapi.TransportConfig{
Host: stackURLParsed.Host,
Schemes: []string{stackURLParsed.Scheme},
APIKey: token.Key,
Host: stackURLParsed.Host,
Schemes: []string{stackURLParsed.Scheme},
BasePath: "api",
APIKey: token.Key,
NumRetries: 5,
RetryTimeout: 10 * time.Second,
})

cleanup := func() error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func testAccGrafanaAuthCheckServiceAccounts(stack *gcom.FormattedApiInstance, ex

response, err := c.ServiceAccounts.SearchOrgServiceAccountsWithPaging(service_accounts.NewSearchOrgServiceAccountsWithPagingParams())
if err != nil {
return err
return fmt.Errorf("failed to get service accounts: %w", err)
}

var foundSAs []string
Expand Down

0 comments on commit eaeb08b

Please sign in to comment.