Skip to content

Commit

Permalink
Fix the order of checkage
Browse files Browse the repository at this point in the history
Signed-off-by: DylanGuedes <[email protected]>
  • Loading branch information
DylanGuedes committed Nov 29, 2024
1 parent 70782bb commit e1a06ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions providers/azure/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ func getContainerClient(conf Config, wrapRoundtripper func(http.RoundTripper) ht
}

func getTokenCredential(conf Config) (azcore.TokenCredential, error) {
if conf.UserAssignedID == "" {
return azidentity.NewDefaultAzureCredential(nil)
}

if conf.ClientSecret != "" && conf.TenantID != "" && conf.ClientID != "" {
return azidentity.NewClientSecretCredential(conf.TenantID, conf.ClientID, conf.ClientSecret, &azidentity.ClientSecretCredentialOptions{})
}

if conf.UserAssignedID == "" {
return azidentity.NewDefaultAzureCredential(nil)
}

msiOpt := &azidentity.ManagedIdentityCredentialOptions{}
msiOpt.ID = azidentity.ClientID(conf.UserAssignedID)
return azidentity.NewManagedIdentityCredential(msiOpt)
Expand Down

0 comments on commit e1a06ba

Please sign in to comment.