Merge pull request #26463 from hashicorp/kt/azurerm-secret-backend-fix

AzureRM backend: correctly lookup environment from metadata host
This commit is contained in:
James Bardin 2020-10-05 14:26:32 -04:00 committed by GitHub
commit 5e13d57f4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -33,8 +33,8 @@ type ArmClient struct {
sasToken string sasToken string
} }
func buildArmClient(config BackendConfig) (*ArmClient, error) { func buildArmClient(ctx context.Context, config BackendConfig) (*ArmClient, error) {
env, err := buildArmEnvironment(config) env, err := authentication.AzureEnvironmentByNameFromEndpoint(ctx, config.MetadataHost, config.Environment)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -73,7 +73,7 @@ func buildTestClient(t *testing.T, res resourceNames) *ArmClient {
// Endpoint is optional (only for Stack) // Endpoint is optional (only for Stack)
endpoint := os.Getenv("ARM_ENDPOINT") endpoint := os.Getenv("ARM_ENDPOINT")
armClient, err := buildArmClient(BackendConfig{ armClient, err := buildArmClient(context.TODO(), BackendConfig{
SubscriptionID: subscriptionID, SubscriptionID: subscriptionID,
TenantID: tenantID, TenantID: tenantID,
ClientID: clientID, ClientID: clientID,