Skip to content

Commit

Permalink
fixing provider config
Browse files Browse the repository at this point in the history
  • Loading branch information
faizan-younus committed Oct 19, 2023
1 parent 14a0d60 commit b8152ea
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions internal/clients/azuread.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,10 @@ const (
errExtractCredentials = "cannot extract credentials"
errTenantIDNotSet = "tenant ID must be set in ProviderConfig when credential source is InjectedIdentity, OIDCTokenFile or Upbound"
errUnmarshalCredentials = "cannot unmarshal azuread credentials as JSON"
keyClientID = "clientID"
keySubscriptionID = "subscription_id"
keyUseMSI = "use_msi"
keyMSIEndpoint = "msi_endpoint"
keyEnvironment = "environment"
keyClientSecret = "clientSecret"
keyTenantID = "tenantID"
keyTerraformClientID = "client_id"
keyTerraformClientSecret = "client_secret"
keyTerraformTenantID = "tenant_id"
Expand Down Expand Up @@ -96,13 +93,13 @@ func msiAuth(pc *v1beta1.ProviderConfig, ps *terraform.Setup) error {
if pc.Spec.TenantID == nil || len(*pc.Spec.TenantID) == 0 {
return errors.New(errTenantIDNotSet)
}
ps.Configuration[keyTenantID] = *pc.Spec.TenantID
ps.Configuration[keyTerraformTenantID] = *pc.Spec.TenantID
ps.Configuration[keyUseMSI] = "true"
if pc.Spec.MSIEndpoint != nil {
ps.Configuration[keyMSIEndpoint] = *pc.Spec.MSIEndpoint
}
if pc.Spec.ClientID != nil {
ps.Configuration[keyClientID] = *pc.Spec.ClientID
ps.Configuration[keyTerraformClientID] = *pc.Spec.ClientID
}
if pc.Spec.Environment != nil {
ps.Configuration[keyEnvironment] = *pc.Spec.Environment
Expand Down

0 comments on commit b8152ea

Please sign in to comment.