mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 06:10:22 +00:00
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>
This commit is contained in:
parent
2369b15409
commit
38f5e860e2
@ -21,6 +21,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
kmsapi "github.com/ceph/ceph-csi/internal/kms"
|
kmsapi "github.com/ceph/ceph-csi/internal/kms"
|
||||||
"github.com/ceph/ceph-csi/internal/util"
|
"github.com/ceph/ceph-csi/internal/util"
|
||||||
@ -341,7 +342,8 @@ func ParseEncryptionOpts(
|
|||||||
encrypted, kmsID string
|
encrypted, kmsID string
|
||||||
)
|
)
|
||||||
encrypted, ok = volOptions["encrypted"]
|
encrypted, ok = volOptions["encrypted"]
|
||||||
if !ok {
|
val, _ := strconv.ParseBool(encrypted)
|
||||||
|
if !ok || !val{
|
||||||
return "", util.EncryptionTypeNone, nil
|
return "", util.EncryptionTypeNone, nil
|
||||||
}
|
}
|
||||||
kmsID, err = util.FetchEncryptionKMSID(encrypted, volOptions["encryptionKMSID"])
|
kmsID, err = util.FetchEncryptionKMSID(encrypted, volOptions["encryptionKMSID"])
|
||||||
|
Loading…
Reference in New Issue
Block a user