From 826f392a9ffaf493ba7a250480b8776289742cb7 Mon Sep 17 00:00:00 2001 From: riya-singhal31 Date: Wed, 24 May 2023 16:22:52 +0530 Subject: [PATCH] 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 (cherry picked from commit 38f5e860e2a0832bbe53597cc796800cfa24664e) --- 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 ea65f14aa..aadf3f9ba 100644 --- a/internal/rbd/encryption.go +++ b/internal/rbd/encryption.go @@ -21,6 +21,7 @@ import ( "errors" "fmt" "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 } kmsID, err = util.FetchEncryptionKMSID(encrypted, volOptions["encryptionKMSID"])