From e7aa71b4598459a65d4d4ec3bee3de052b39fee6 Mon Sep 17 00:00:00 2001 From: riya-singhal31 Date: Wed, 24 May 2023 16:22:52 +0530 Subject: [PATCH 1/2] rbd: add check for EncryptionTypeNone this commit adds the validation for encryption value as false, and sets the type as none Signed-off-by: riya-singhal31 --- internal/rbd/encryption.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/rbd/encryption.go b/internal/rbd/encryption.go index 3d68e80c898..57e866202a0 100644 --- a/internal/rbd/encryption.go +++ b/internal/rbd/encryption.go @@ -22,6 +22,7 @@ import ( "fmt" "strconv" "strings" + "strconv" kmsapi "github.com/ceph/ceph-csi/internal/kms" "github.com/ceph/ceph-csi/internal/util" @@ -341,7 +342,8 @@ func ParseEncryptionOpts( encrypted, kmsID string ) encrypted, ok = volOptions["encrypted"] - if !ok { + val, _ := strconv.ParseBool(encrypted) + if !ok || !val{ return "", util.EncryptionTypeNone, nil } ok, err = strconv.ParseBool(encrypted) From ebdff60be4cec3d2b4e3c8be65819c009c3ad3a8 Mon Sep 17 00:00:00 2001 From: riya-singhal31 Date: Wed, 24 May 2023 16:22:52 +0530 Subject: [PATCH 2/2] rbd: add check for EncryptionTypeNone this commit adds the validation for encryption value as false, and sets the type as none Signed-off-by: riya-singhal31 --- internal/rbd/encryption.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/rbd/encryption.go b/internal/rbd/encryption.go index 57e866202a0..4e1e50e82eb 100644 --- a/internal/rbd/encryption.go +++ b/internal/rbd/encryption.go @@ -22,7 +22,6 @@ import ( "fmt" "strconv" "strings" - "strconv" kmsapi "github.com/ceph/ceph-csi/internal/kms" "github.com/ceph/ceph-csi/internal/util" @@ -343,7 +342,7 @@ func ParseEncryptionOpts( ) encrypted, ok = volOptions["encrypted"] val, _ := strconv.ParseBool(encrypted) - if !ok || !val{ + if !ok || !val { return "", util.EncryptionTypeNone, nil } ok, err = strconv.ParseBool(encrypted)