change pv recycler scrub cmd to find -delete

PVs with large amount of files cannot be recycted with "rm" command and
are left in "Failed" state.
Hence we are switching to "find -delete" command.
This commit is contained in:
Dmitri Fedotov
2023-04-13 12:19:01 +03:00
parent aab9a7c262
commit 625c302505
2 changed files with 2 additions and 2 deletions

View File

@@ -3115,7 +3115,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

View File

@@ -1065,7 +1065,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",