From b8d5618c9f994b5d11f5d6b133838f8cfcdc69cd Mon Sep 17 00:00:00 2001 From: Roman Vanicek Date: Mon, 6 May 2024 00:30:54 +0200 Subject: [PATCH] Fix option parsing --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 231315e..5776af2 100644 --- a/main.go +++ b/main.go @@ -353,7 +353,7 @@ func (d *ofsDriver) Mount(r *volume.MountRequest) (*volume.MountResponse, error) log.WithFields(log.Fields{"name": v.Volume.Name, "snapshot": v.BackupSnapshot}).Info("Failed to create a new backup snapshot") return &volume.MountResponse{}, err } else { - v.BackupSnapshot = strings.SplitAfter(snapshotIdWithSuffix, " ")[0] + v.BackupSnapshot = strings.Split(snapshotIdWithSuffix, " ")[0] fs = v.BackupSnapshot } } @@ -846,7 +846,7 @@ func setIntersect[TKey comparable, TValue any, TValue2 any](a map[TKey]TValue, b } func addMountOption(mountOpts map[string]string, keyVal string) { - keyValA := strings.SplitAfterN(keyVal, "=", 2) + keyValA := strings.SplitN(keyVal, "=", 2) key := keyValA[0] var val string if len(keyValA) <= 1 {