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
}
func buildArmClient(config BackendConfig) (*ArmClient, error) {
env, err := buildArmEnvironment(config)
func buildArmClient(ctx context.Context, config BackendConfig) (*ArmClient, error) {
env, err := authentication.AzureEnvironmentByNameFromEndpoint(ctx, config.MetadataHost, config.Environment)
if err != nil {
return nil, err
}

View File

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