Signed-off-by: Joseph Sawaya <jsawaya@redhat.com>
if not hasattr(new_cluster.spec.storage, 'storageClassDeviceSets') or not new_cluster.spec.storage.storageClassDeviceSets:
new_cluster.spec.storage.storageClassDeviceSets = ccl.StorageClassDeviceSetsList()
+ existing_scds = [
+ scds.name for scds in new_cluster.spec.storage.storageClassDeviceSets
+ ]
for device in to_create:
new_scds = self.device_to_device_set(drive_group, device)
new_cluster.spec.storage.storageClassDeviceSets.append(new_scds)
+ if new_scds.name not in existing_scds:
+ new_cluster.spec.storage.storageClassDeviceSets.append(new_scds)
return new_cluster
return _add_osds