Skip to content

Commit 9bdf0c8

Browse files
andyzhangxk8s-infra-cherrypick-robot
authored andcommitted
fix: override aznfs AZURE_ENDPOINT_OVERRIDE
fix
1 parent eec4e9b commit 9bdf0c8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/blob/nodeserver.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,12 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe
334334
mountType = NFS
335335
}
336336

337+
if storageEndpointSuffix != "" && mountType == AZNFS {
338+
aznfsEndpoint := strings.Replace(storageEndpointSuffix, "core.", "", 1)
339+
klog.V(2).Infof("set AZURE_ENDPOINT_OVERRIDE to %s", aznfsEndpoint)
340+
os.Setenv("AZURE_ENDPOINT_OVERRIDE", aznfsEndpoint)
341+
}
342+
337343
source := fmt.Sprintf("%s:/%s/%s", serverAddress, accountName, containerName)
338344
mountOptions := util.JoinMountOptions(mountFlags, []string{"sec=sys,vers=3,nolock"})
339345
if err := wait.PollImmediate(1*time.Second, 2*time.Minute, func() (bool, error) {

0 commit comments

Comments
 (0)