Determine image to use for Persistent Volume Recycling
The scrubber pod needs to use an approved and supported OpenShift image, not busybox.
The current implementation is this:
Containers: []api.Container{
{
Name: "scrubber",
Image: "busybox",
// delete the contents of the volume, but not the directory itself
Command: []string{"/bin/sh"},
// the scrubber:
// 1. validates the /scrub directory exists
// 2. creates a text file in the directory to be scrubbed
// 3. performs rm -rf on the directory
// 4. tests to see if the directory is empty
// the pod fails if the error code is returned
Args: []string{"-c", "test -e /scrub && echo $(date) > /scrub/trash.txt && rm -rf /scrub/* && test -z \"$(ls -A /scrub)\" || exit 1"},
VolumeMounts: []api.VolumeMount{
{
Name: "vol",
MountPath: "/scrub",
},
},
},
},
@smarterclayton
@sosiouxme you were discussing this in the bluejeans chat
Thanks, Mark. Yeah, the pattern to follow would presumably be whatever we did for the kubernetes "pause" image which became "origin-pod" in Origin, overridden by the --images specification given to the node/master config.
Put the core code in openshift/origin and then we'll use one of the existing images (with an existing component name) to handle this.
As a bash script or something.