Merge pull request #16314 from rook/mergify/bp/release-1.17/pr-16293

operator: mount udev to cleanup job and disable udev sync (backport #16293)
This commit is contained in:
mergify[bot] authored and GitHub committed 2025-08-14 20:00:19 +00:00
commit 85d4dd7d60
1 file changed
+10 -1
+10 -1
View File
@@ -122,7 +122,12 @@ func (c *ClusterController) cleanUpJobContainer(cluster *cephv1.CephCluster, mon
{Name: sanitizeDataSource, Value: cluster.Spec.CleanupPolicy.SanitizeDisks.DataSource.String()},
{Name: sanitizeIteration, Value: strconv.Itoa(int(cluster.Spec.CleanupPolicy.SanitizeDisks.Iteration))},
}...)
if controller.LoopDevicesAllowed() {
// mount udev for host based clusters
if len(cluster.Spec.Storage.StorageClassDeviceSets) == 0 {
volumeMounts = append(volumeMounts, v1.VolumeMount{Name: "run-udev", MountPath: "/run/udev"})
envVars = append(envVars, v1.EnvVar{Name: "DM_DISABLE_UDEV", Value: "1"})
}
if opcontroller.LoopDevicesAllowed() {
envVars = append(envVars, v1.EnvVar{Name: "CEPH_VOLUME_ALLOW_LOOP_DEVICES", Value: "true"})
}
}
@@ -150,6 +155,10 @@ func (c *ClusterController) cleanUpJobTemplateSpec(cluster *cephv1.CephCluster,
devVolume := v1.Volume{Name: "devices", VolumeSource: v1.VolumeSource{HostPath: &v1.HostPathVolumeSource{Path: "/dev"}}}
volumes = append(volumes, hostPathVolume)
volumes = append(volumes, devVolume)
// mount udev for host based clusters
if len(cluster.Spec.Storage.StorageClassDeviceSets) == 0 {
volumes = append(volumes, v1.Volume{Name: "run-udev", VolumeSource: v1.VolumeSource{HostPath: &v1.HostPathVolumeSource{Path: "/run/udev"}}})
}
podSpec := v1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{