Skip to content

Commit 08b4d97

Browse files
authored
Merge pull request #1447 from k8s-infra-cherrypick-robot/cherry-pick-1439-to-release-1.22
[release-1.22] fix: override aznfs AZURE_ENDPOINT_OVERRIDE
2 parents 6eeaab3 + aa8711b commit 08b4d97

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
@@ -315,6 +315,12 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe
315315
mountType = NFS
316316
}
317317

318+
if storageEndpointSuffix != "" && mountType == AZNFS {
319+
aznfsEndpoint := strings.Replace(storageEndpointSuffix, "core.", "", 1)
320+
klog.V(2).Infof("set AZURE_ENDPOINT_OVERRIDE to %s", aznfsEndpoint)
321+
os.Setenv("AZURE_ENDPOINT_OVERRIDE", aznfsEndpoint)
322+
}
323+
318324
source := fmt.Sprintf("%s:/%s/%s", serverAddress, accountName, containerName)
319325
mountOptions := util.JoinMountOptions(mountFlags, []string{"sec=sys,vers=3,nolock"})
320326
if err := wait.PollImmediate(1*time.Second, 2*time.Minute, func() (bool, error) {

0 commit comments

Comments
 (0)