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 <rsinghal@redhat.com>
(cherry picked from commit 38f5e860e2)
This commit is contained in:
riya-singhal31 2023-05-24 16:22:52 +05:30 committed by mergify[bot]
parent aa4271a32a
commit 826f392a9f

View File

@ -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"])