diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index 39e60000ebd..51f21dd7642 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -3116,7 +3116,7 @@ spec: - /bin/sh args: - -c - - test -e /scrub && rm -rf /scrub/..?* /scrub/.[!.]* /scrub/* && test -z $(ls -A /scrub) || exit 1 + - test -e /scrub && find /scrub -mindepth 1 -delete && test -z $(ls -A /scrub) || exit 1 volumeMounts: - name: vol mountPath: /scrub diff --git a/pkg/volume/plugins.go b/pkg/volume/plugins.go index 00874fbf7ed..2b19f97f134 100644 --- a/pkg/volume/plugins.go +++ b/pkg/volume/plugins.go @@ -1063,7 +1063,7 @@ func NewPersistentVolumeRecyclerPodTemplate() *v1.Pod { Name: "pv-recycler", Image: "registry.k8s.io/debian-base:v2.0.0", Command: []string{"/bin/sh"}, - Args: []string{"-c", "test -e /scrub && rm -rf /scrub/..?* /scrub/.[!.]* /scrub/* && test -z \"$(ls -A /scrub)\" || exit 1"}, + Args: []string{"-c", "test -e /scrub && find /scrub -mindepth 1 -delete && test -z \"$(ls -A /scrub)\" || exit 1"}, VolumeMounts: []v1.VolumeMount{ { Name: "vol",