Skip to content

Commit

Permalink
rbd: add check for EncryptionTypeNone
Browse files Browse the repository at this point in the history
this commit adds the validation for encryption
value as false, and sets the type as none

Signed-off-by: riya-singhal31 <rsinghal@redhat.com>
  • Loading branch information
riya-singhal31 authored and mergify[bot] committed Jun 6, 2023
1 parent 2369b15 commit 38f5e86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/rbd/encryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"errors"
"fmt"
"strings"
"strconv"

kmsapi "github.com/ceph/ceph-csi/internal/kms"
"github.com/ceph/ceph-csi/internal/util"
Expand Down Expand Up @@ -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"])
Expand Down

0 comments on commit 38f5e86

Please sign in to comment.