Skip to content

Commit

Permalink
storagecluster: do not set metadata for deviceType
Browse files Browse the repository at this point in the history
do not set metadata for deviceType storagecluster
just check for deviceType.

Signed-off-by: crombus <pkundra@redhat.com>
  • Loading branch information
crombus committed Dec 8, 2020
1 parent 9fb2553 commit 2c9e6e1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/controller/storagecluster/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,7 @@ func (r *ReconcileStorageCluster) validateStorageDeviceSets(sc *ocsv1.StorageClu
}
}
if ds.DeviceType != "" {
if (DeviceTypeSSD == strings.ToLower(ds.DeviceType)) || (DeviceTypeHDD == strings.ToLower(ds.DeviceType)) || (DeviceTypeNVMe == strings.ToLower(ds.DeviceType)) {
metav1.SetMetaDataAnnotation(&sc.ObjectMeta, "crushDeviceClass", ds.DeviceType)
} else {
if (DeviceTypeSSD != strings.ToLower(ds.DeviceType)) && (DeviceTypeHDD != strings.ToLower(ds.DeviceType)) && (DeviceTypeNVMe != strings.ToLower(ds.DeviceType)) {
return fmt.Errorf("failed to validate DeviceType %q: no Device of this type", ds.DeviceType)
}
}
Expand Down

0 comments on commit 2c9e6e1

Please sign in to comment.