Skip to content

Commit 39e27e4

Browse files
csi: correct conditional logic for fuse mount options argument
Previously, the function incorrectly checked if `len(options) == 0`, causing it to return a non-empty argument when no options were provided. This fix updates the condition to `len(options) > 0`, ensuring the argument is only set when options exist. Signed-off-by: Praveen M <m.praveen@ibm.com>
1 parent 31a93b4 commit 39e27e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/utils/csi.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,14 +439,14 @@ func LogRotateConfigMapName(driverName string) string {
439439
func KernelMountOptionsContainerArg(options map[string]string) string {
440440
return If(
441441
len(options) > 0,
442-
fmt.Sprintf("--kernelmountoptions==%s", MapToString(options, "=", ",")),
442+
fmt.Sprintf("--kernelmountoptions=%s", MapToString(options, "=", ",")),
443443
"",
444444
)
445445
}
446446
func FuseMountOptionsContainerArg(options map[string]string) string {
447447
return If(
448-
len(options) == 0,
449-
fmt.Sprintf("--fusemountoptions==%s", MapToString(options, "=", ",")),
448+
len(options) > 0,
449+
fmt.Sprintf("--fusemountoptions=%s", MapToString(options, "=", ",")),
450450
"",
451451
)
452452
}

0 commit comments

Comments
 (0)