@@ -39,7 +39,6 @@ import (
39
39
regopclient "github.com/openshift/cluster-image-registry-operator/pkg/client"
40
40
"github.com/openshift/cluster-image-registry-operator/pkg/defaults"
41
41
"github.com/openshift/cluster-image-registry-operator/pkg/envvar"
42
- "github.com/openshift/cluster-image-registry-operator/pkg/filewatcher"
43
42
"github.com/openshift/cluster-image-registry-operator/pkg/storage/azure/azureclient"
44
43
"github.com/openshift/cluster-image-registry-operator/pkg/storage/util"
45
44
)
@@ -372,7 +371,6 @@ func (d *driver) storageAccountsClient(cfg *Azure, environment autorestazure.Env
372
371
cred azcore.TokenCredential
373
372
err error
374
373
)
375
- managedIdentityClientID := os .Getenv ("ARO_HCP_MI_CLIENT_ID" )
376
374
userAssignedIdentityCredentialsFilePath := os .Getenv ("MANAGED_AZURE_HCP_CREDENTIALS_FILE_PATH" )
377
375
if userAssignedIdentityCredentialsFilePath != "" {
378
376
// UserAssignedIdentityCredentials for managed Azure HCP
@@ -384,39 +382,6 @@ func (d *driver) storageAccountsClient(cfg *Azure, environment autorestazure.Env
384
382
if err != nil {
385
383
return storage.AccountsClient {}, err
386
384
}
387
- } else if managedIdentityClientID != "" {
388
- // Managed Identity Override for ARO HCP
389
- klog .V (2 ).Info ("Using client certification Azure authentication for ARO HCP" )
390
- options := & azidentity.ClientCertificateCredentialOptions {
391
- ClientOptions : azcore.ClientOptions {
392
- Cloud : cloudConfig ,
393
- },
394
- SendCertificateChain : true ,
395
- }
396
-
397
- tenantID := os .Getenv ("ARO_HCP_TENANT_ID" )
398
- certPath := os .Getenv ("ARO_HCP_CLIENT_CERTIFICATE_PATH" )
399
-
400
- certData , err := os .ReadFile (certPath )
401
- if err != nil {
402
- return storage.AccountsClient {}, fmt .Errorf (`failed to read certificate file "%s": %v` , certPath , err )
403
- }
404
-
405
- certs , key , err := azidentity .ParseCertificates (certData , []byte {})
406
- if err != nil {
407
- return storage.AccountsClient {}, fmt .Errorf (`failed to parse certificate data "%s": %v` , certPath , err )
408
- }
409
-
410
- // Watch the certificate for changes; if the certificate changes, the pod will be restarted
411
- err = filewatcher .WatchFileForChanges (certPath )
412
- if err != nil {
413
- return storage.AccountsClient {}, err
414
- }
415
-
416
- cred , err = azidentity .NewClientCertificateCredential (tenantID , managedIdentityClientID , certs , key , options )
417
- if err != nil {
418
- return storage.AccountsClient {}, err
419
- }
420
385
} else if strings .TrimSpace (cfg .ClientSecret ) == "" {
421
386
options := azidentity.WorkloadIdentityCredentialOptions {
422
387
ClientOptions : azcore.ClientOptions {
0 commit comments