Skip to content

Commit

Permalink
add default auth_region
Browse files Browse the repository at this point in the history
  • Loading branch information
Icerzack committed Mar 21, 2024
1 parent 1ba9552 commit 7d55015
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion selectel/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ func getIAMClient(meta interface{}) (*iam.Client, diag.Diagnostics) {
if err != nil {
return nil, diag.FromErr(fmt.Errorf("can't get selvpc client for iam: %w", err))
}

if config.AuthRegion == "" {
config.AuthRegion = "ru-1"
}

apiURL, err := getEndpointForIAM(selvpcClient, config.AuthRegion)
if err != nil {
return nil, diag.FromErr(err)
}

iamClient, err := iam.New(
iam.WithAuthOpts(&iam.AuthOpts{
KeystoneToken: selvpcClient.GetXAuthToken(),
Expand Down

0 comments on commit 7d55015

Please sign in to comment.