diff --git a/internal/acceptance_test/helper.go b/internal/acceptance_test/helper.go index 3026eb4c..234568fd 100644 --- a/internal/acceptance_test/helper.go +++ b/internal/acceptance_test/helper.go @@ -104,7 +104,7 @@ func getHeadersAndQueryParamsAndIAMVersion() (map[string]string, map[string]stri constants.LocationKey: os.Getenv("HPEGL_VMAAS_LOCATION"), } if iamVersion == constants.IamGlp { - queryParam[constants.WorkspaceKey] = os.Getenv("HPEGL_VMAAS_SPACE_NAME") + queryParam[constants.TenantIDKey] = os.Getenv("HPEGL_VMAAS_SPACE_NAME") } else { queryParam[constants.SpaceKey] = os.Getenv("HPEGL_VMAAS_SPACE_NAME") } diff --git a/pkg/client/client.go b/pkg/client/client.go index 5ebef358..9a6f0095 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -62,15 +62,17 @@ func (i InitialiseClient) NewClient(r *schema.ResourceData) (interface{}, error) queryParam := map[string]string{ constants.LocationKey: vmaasProviderSettings[constants.LOCATION].(string), } + tenantID := "" if iamVersion == constants.IamGlp { - queryParam[constants.WorkspaceKey] = vmaasProviderSettings[constants.SPACENAME].(string) + queryParam[constants.TenantIDKey] = vmaasProviderSettings[constants.SPACENAME].(string) + tenantID = vmaasProviderSettings[constants.SPACENAME].(string) } else { queryParam[constants.SpaceKey] = vmaasProviderSettings[constants.SPACENAME].(string) + tenantID = r.Get(constants.TenantID).(string) } // Create broker client brokerHeaders := getHeaders() - tenantID := r.Get(constants.TenantID).(string) brokerHeaders["X-Tenant-ID"] = tenantID // We don't add default query params to broker client brokerCfgForAPIClient := api_client.Configuration{ diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index 9255d612..b75c1a2a 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -12,14 +12,14 @@ const ( IamGlcs string = "glcs" TenantID string = "tenant_id" - LOCATION = "location" - SPACENAME = "space_name" - APIURL = "api_url" - BROKERRURL = "broker_url" - INSECURE = "allow_insecure" - SpaceKey = "space" - WorkspaceKey = "workspaceID" - LocationKey = "location" + LOCATION = "location" + SPACENAME = "space_name" + APIURL = "api_url" + BROKERRURL = "broker_url" + INSECURE = "allow_insecure" + SpaceKey = "space" + TenantIDKey = "tenantID" + LocationKey = "location" MockIAMKey = "TF_ACC_MOCK_IAM" CmpSubjectKey = "TF_ACC_CMP_SUBJECT"