Merge pull request #16315 from rook/mergify/bp/release-1.18/pr-16293
operator: mount udev to cleanup job and disable udev sync (backport #16293)
This commit is contained in:
1 file changed
+9
@@ -121,6 +121,11 @@ 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))},
|
||||
}...)
|
||||
// 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"})
|
||||
}
|
||||
@@ -149,6 +154,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{
|
||||
|
||||
Reference in new issue
Block a user