Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions openstack/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,11 @@ func v3AKSKAuth(client *golangsdk.ProviderClient, endpoint string, options golan
v3Client.Endpoint = endpoint
}

defer func() {
v3Client.AKSKAuthOptions.ProjectId = options.ProjectId
}()
v3Client.AKSKAuthOptions = options
v3Client.AKSKAuthOptions.ProjectId = ""

if options.ProjectId == "" && options.ProjectName != "" {
id, err := getProjectID(v3Client, options.ProjectName)
Expand Down
4 changes: 3 additions & 1 deletion provider_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ func (client *ProviderClient) Request(method, url string, options *RequestOpts)
AccessKey: client.AKSKAuthOptions.AccessKey,
SecretKey: client.AKSKAuthOptions.SecretKey,
})
req.Header.Set("X-Project-Id", client.AKSKAuthOptions.ProjectId)
if client.AKSKAuthOptions.ProjectId != "" {
req.Header.Set("X-Project-Id", client.AKSKAuthOptions.ProjectId)
}
}

// Issue the request.
Expand Down