Skip to content

Commit bea3489

Browse files
authored
Merge pull request #585 from andyzhangx/append-timestamp
feat: add append-timestamp-cache-dir support in chart
2 parents 9bd5fab + 961eb30 commit bea3489

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed
38 Bytes
Binary file not shown.

charts/latest/blob-csi-driver/templates/csi-blob-node.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ spec:
123123
- "--user-agent-suffix={{ .Values.driver.userAgentSuffix }}"
124124
- "--allow-empty-cloud-config={{ .Values.node.allowEmptyCloudConfig }}"
125125
- "--enable-get-volume-stats={{ .Values.feature.enableGetVolumeStats }}"
126+
- "--append-timestamp-cache-dir={{ .Values.node.appendTimeStampInCacheDir }}"
126127
ports:
127128
- containerPort: {{ .Values.node.livenessProbe.healthPort }}
128129
name: healthz

charts/latest/blob-csi-driver/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ node:
122122
maxOpenFileNum: "9000000"
123123
disableUpdateDB: true
124124
blobfuseCachePath: /mnt
125+
appendTimeStampInCacheDir: false
125126
resources:
126127
livenessProbe:
127128
limits:

pkg/blob/blob.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ type DriverOptions struct {
120120
EnableBlobMockMount bool
121121
AllowEmptyCloudConfig bool
122122
EnableGetVolumeStats bool
123+
AppendTimeStampInCacheDir bool
123124
}
124125

125126
// Driver implements all interfaces of CSI drivers
@@ -132,13 +133,14 @@ type Driver struct {
132133
userAgentSuffix string
133134
blobfuseProxyEndpoint string
134135
// enableBlobMockMount is only for testing, DO NOT set as true in non-testing scenario
135-
enableBlobMockMount bool
136-
enableBlobfuseProxy bool
137-
allowEmptyCloudConfig bool
138-
enableGetVolumeStats bool
139-
blobfuseProxyConnTimout int
140-
mounter *mount.SafeFormatAndMount
141-
volLockMap *util.LockMap
136+
enableBlobMockMount bool
137+
enableBlobfuseProxy bool
138+
allowEmptyCloudConfig bool
139+
enableGetVolumeStats bool
140+
appendTimeStampInCacheDir bool
141+
blobfuseProxyConnTimout int
142+
mounter *mount.SafeFormatAndMount
143+
volLockMap *util.LockMap
142144
// A map storing all volumes with ongoing operations so that additional operations
143145
// for that same volume (as defined by VolumeID) return an Aborted error
144146
volumeLocks *volumeLocks

pkg/blob/nodeserver.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe
278278
mountOptions = util.JoinMountOptions(mountOptions, []string{"--use-adls=true"})
279279
}
280280
tmpPath := fmt.Sprintf("%s/%s", "/mnt", volumeID)
281+
if d.appendTimeStampInCacheDir {
282+
tmpPath += fmt.Sprintf("#%d", time.Now().Unix())
283+
}
281284
mountOptions = appendDefaultMountOptions(mountOptions, tmpPath, containerName)
282285

283286
args := targetPath

pkg/blobplugin/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ var (
5252
userAgentSuffix = flag.String("user-agent-suffix", "", "userAgent suffix")
5353
allowEmptyCloudConfig = flag.Bool("allow-empty-cloud-config", true, "allow running driver without cloud config")
5454
enableGetVolumeStats = flag.Bool("enable-get-volume-stats", false, "allow GET_VOLUME_STATS on agent node")
55+
appendTimeStampInCacheDir = flag.Bool("append-timestamp-cache-dir", false, "append timestamp into cache directory on agent node")
5556
)
5657

5758
func main() {
@@ -85,6 +86,7 @@ func handle() {
8586
UserAgentSuffix: *userAgentSuffix,
8687
AllowEmptyCloudConfig: *allowEmptyCloudConfig,
8788
EnableGetVolumeStats: *enableGetVolumeStats,
89+
AppendTimeStampInCacheDir: *appendTimeStampInCacheDir,
8890
}
8991
driver := blob.NewDriver(&driverOptions)
9092
if driver == nil {

0 commit comments

Comments
 (0)