Skip to content

Commit

Permalink
Merge pull request openshift#229 from staebler/azure_other_cloud_env_2
Browse files Browse the repository at this point in the history
minter: azure authorizer needs to have ActiveDirectory endpoint specified
  • Loading branch information
openshift-merge-robot authored Jul 23, 2020
2 parents e5d1e9c + 8d924bf commit 79537fb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/azure/minter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (
configv1 "github.com/openshift/api/config/v1"
)

func getAuthorizer(clientID, clientSecret, tenantID, resourceEndpoint string) (autorest.Authorizer, error) {
func getAuthorizer(clientID, clientSecret, tenantID string, env azure.Environment, resourceEndpoint string) (autorest.Authorizer, error) {
config := auth.NewClientCredentialsConfig(clientID, clientSecret, tenantID)
config.Resource = resourceEndpoint
config.AADEndpoint = env.ActiveDirectoryEndpoint
return config.Authorizer()
}

Expand Down Expand Up @@ -57,12 +58,12 @@ func NewAzureCredentialsMinter(logger log.FieldLogger, clientID, clientSecret st
if err != nil {
return nil, fmt.Errorf("Unable to determine Azure environment: %w", err)
}
graphAuthorizer, err := getAuthorizer(clientID, clientSecret, tenantID, env.GraphEndpoint)
graphAuthorizer, err := getAuthorizer(clientID, clientSecret, tenantID, env, env.GraphEndpoint)
if err != nil {
return nil, fmt.Errorf("Unable to construct GraphEndpoint authorizer: %v", err)
}

rmAuthorizer, err := getAuthorizer(clientID, clientSecret, tenantID, env.ResourceManagerEndpoint)
rmAuthorizer, err := getAuthorizer(clientID, clientSecret, tenantID, env, env.ResourceManagerEndpoint)
if err != nil {
return nil, fmt.Errorf("Unable to construct ResourceManagerEndpoint authorizer: %v", err)
}
Expand Down

0 comments on commit 79537fb

Please sign in to comment.