Skip to content

Commit

Permalink
Merge pull request #9389 from rook/mergify/bp/release-1.8/pr-9380
Browse files Browse the repository at this point in the history
osd: cleanup cluster using the root UID (backport #9380)
  • Loading branch information
mergify[bot] committed Dec 10, 2021
2 parents 4d5fca8 + 0f5658f commit 35dacb7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/operator/ceph/cluster/cleanup.go
Expand Up @@ -123,10 +123,18 @@ func (c *ClusterController) cleanUpJobContainer(cluster *cephv1.CephCluster, mon
}...)
}

// Run a UID 0 since ceph-volume does not support running non-root
// See https://tracker.ceph.com/issues/53511
// Also, it's hard to catch the ceph version since the cluster is being deleted so not
// implementing a version check and simply always run this as root
rootUserID := int64(0)
securityContext := osd.PrivilegedContext()
securityContext.RunAsUser = &rootUserID

return v1.Container{
Name: "host-cleanup",
Image: c.rookImage,
SecurityContext: osd.PrivilegedContext(),
SecurityContext: securityContext,
VolumeMounts: volumeMounts,
Env: envVars,
Args: []string{"ceph", "clean"},
Expand Down

0 comments on commit 35dacb7

Please sign in to comment.