openshift-management icon indicating copy to clipboard operation
openshift-management copied to clipboard

cronjob_etcd_backup: Use mindepth + maxdepth params

Open vinzent opened this issue 3 years ago • 0 comments
trafficstars

What is this PR About?

The cronjob pod exists unsuccessful when it deletes old backups (sometimes). It depends on how find lists the directories to be passed to rm -rv. If it doesn't exist anymore, it will fail.

Removing the "*" globbing and using min-/maxdepth params will find all dirs directly below /mnt/backup. So it will only call rm -rv once per directory.

Another workaround could be to add -f to rm which would ignore non-existent paths to remove.

How do we test this?

Check status and logs of finished CronJob pods.

cc: @redhat-cop/casl

vinzent avatar Jun 15 '22 11:06 vinzent