Skip to content

Commit

Permalink
azure.go: temporary patch for workload identity usage with secret cc
Browse files Browse the repository at this point in the history
  • Loading branch information
chaireze committed Jun 21, 2023
1 parent ad0a9b4 commit f5334c0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/blob/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ func getCloudProvider(kubeconfig, nodeID, secretName, secretNamespace, userAgent
if err != nil {
klog.V(2).Infof("InitializeCloudFromSecret: failed to get cloud config from secret %s/%s: %v", az.SecretNamespace, az.SecretName, err)
}

if tenantID := os.Getenv("AZURE_TENANT_ID"); tenantID != "" {
config.TenantID = tenantID
}
if clientID := os.Getenv("AZURE_CLIENT_ID"); clientID != "" {
config.AADClientID = clientID
}
if federatedTokenFile := os.Getenv("AZURE_FEDERATED_TOKEN_FILE"); federatedTokenFile != "" {
config.AADFederatedTokenFile = federatedTokenFile
config.UseFederatedWorkloadIdentityExtension = true
}
}

if config == nil {
Expand Down

0 comments on commit f5334c0

Please sign in to comment.