Skip to content

Commit edcba1d

Browse files
authored
Merge pull request #578 from andyzhangx/reuse-original-mount-v1.4
fix: avoid using different mount path in remount on v1.4
2 parents cc620eb + 46f013d commit edcba1d

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

pkg/blob/blob.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,9 @@ func appendDefaultMountOptions(mountOptions []string, tmpPath, containerName str
613613
"--tmp-path": tmpPath,
614614
"--container-name": containerName,
615615
// prevent billing charges on mounting
616-
"--cancel-list-on-mount-seconds": "60",
616+
"--cancel-list-on-mount-seconds": "10",
617+
// allow remounting using a non-empty tmp-path
618+
"--empty-dir-check": "false",
617619
}
618620

619621
// stores the mount options already included in mountOptions

pkg/blob/blob_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,9 +786,10 @@ func TestAppendDefaultMountOptions(t *testing.T) {
786786
options: []string{"targetPath"},
787787
tmpPath: "/tmp",
788788
containerName: "containerName",
789-
expected: []string{"--cancel-list-on-mount-seconds=60",
789+
expected: []string{"--cancel-list-on-mount-seconds=10",
790790
"--container-name=containerName",
791791
"--pre-mount-validate=true",
792+
"--empty-dir-check=false",
792793
"--tmp-path=/tmp",
793794
"--use-https=true",
794795
"targetPath",
@@ -801,6 +802,7 @@ func TestAppendDefaultMountOptions(t *testing.T) {
801802
expected: []string{"--cancel-list-on-mount-seconds=0",
802803
"--container-name=containerName",
803804
"--pre-mount-validate=false",
805+
"--empty-dir-check=false",
804806
"--tmp-path=/tmp",
805807
"--use-https=true",
806808
"targetPath",

pkg/blob/nodeserver.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,7 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe
271271
if ephemeralVol {
272272
mountOptions = util.JoinMountOptions(mountOptions, strings.Split(ephemeralVolMountOptions, ","))
273273
}
274-
// set different tmp-path with time info
275-
tmpPath := fmt.Sprintf("%s/%s#%d", "/mnt", volumeID, time.Now().Unix())
274+
tmpPath := fmt.Sprintf("%s/%s", "/mnt", volumeID)
276275
mountOptions = appendDefaultMountOptions(mountOptions, tmpPath, containerName)
277276

278277
args := targetPath

0 commit comments

Comments
 (0)