Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
umagnus committed Dec 13, 2023
1 parent f789524 commit 20fc26d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/blob/controllerserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ func (d *Driver) copyBlobContainer(_ context.Context, req *csi.CreateVolumeReque
}

var accountSasToken string
if d.cloud.Config.AzureAuthConfig.UseFederatedWorkloadIdentityExtension || d.cloud.Config.AzureAuthConfig.UseManagedIdentityExtension {
if len(d.cloud.Config.AADClientSecret) > 0 || d.cloud.Config.AzureAuthConfig.UseManagedIdentityExtension {
err = d.authorizeAzcopyBySecurityPrincipal()
if err != nil {
return err
Expand Down Expand Up @@ -789,7 +789,7 @@ func (d *Driver) copyVolume(ctx context.Context, req *csi.CreateVolumeRequest, a
}

func (d *Driver) authorizeAzcopyBySecurityPrincipal() error {
if d.cloud.Config.AzureAuthConfig.UseFederatedWorkloadIdentityExtension {
if len(d.cloud.Config.AADClientSecret) > 0 {
klog.V(2).Infof("use service principal to authorize azcopy")
os.Setenv("AZCOPY_AUTO_LOGIN_TYPE", "SPN")
if err := os.Setenv("AZCOPY_AUTO_LOGIN_TYPE", "SPN"); err != nil {
Expand Down

0 comments on commit 20fc26d

Please sign in to comment.