File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,21 @@ func getAuthorizerForResource(config Config) (autorest.Authorizer, error) {
7070 }
7171
7272 var cred azcore.TokenCredential
73- if config .AzureWorkloadIdentityEnabled && strings .TrimSpace (config .ClientSecret ) == "" {
73+ // MSI Override for ARO HCP
74+ msi := os .Getenv ("AZURE_MSI_AUTHENTICATION" )
75+ if msi == "true" {
76+ options := azidentity.ManagedIdentityCredentialOptions {
77+ ClientOptions : azcore.ClientOptions {
78+ Cloud : cloudConfig ,
79+ },
80+ }
81+
82+ var err error
83+ cred , err = azidentity .NewManagedIdentityCredential (& options )
84+ if err != nil {
85+ return nil , err
86+ }
87+ } else if config .AzureWorkloadIdentityEnabled && strings .TrimSpace (config .ClientSecret ) == "" {
7488 options := azidentity.WorkloadIdentityCredentialOptions {
7589 ClientOptions : azcore.ClientOptions {
7690 Cloud : cloudConfig ,
You can’t perform that action at this time.
0 commit comments