rbd: removing TrimSpace from validateImageFeatures func

`imageFeatures` string containing just whitespace should also
be treated as a invalid feature.

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R 2021-06-15 09:24:54 +05:30 committed by mergify[bot]
parent 84b046d736
commit 7fc553a3a7

View File

@ -1017,7 +1017,7 @@ func (rv *rbdVolume) validateImageFeatures(imageFeatures string) error {
// the Go split function would return a single item array with // the Go split function would return a single item array with
// an empty string, causing a failure when trying to validate // an empty string, causing a failure when trying to validate
// the features. // the features.
if strings.TrimSpace(imageFeatures) == "" { if imageFeatures == "" {
return nil return nil
} }
arr := strings.Split(imageFeatures, ",") arr := strings.Split(imageFeatures, ",")