From abe173000e908780b2d794475c7662ceb7caf7a9 Mon Sep 17 00:00:00 2001 From: Kuan Fan Date: Mon, 27 May 2024 14:52:53 -0700 Subject: [PATCH] update cleanup cron --- openshift/templates/cleanup/cleanup-cron.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openshift/templates/cleanup/cleanup-cron.yaml b/openshift/templates/cleanup/cleanup-cron.yaml index 4ef48112..b848df96 100644 --- a/openshift/templates/cleanup/cleanup-cron.yaml +++ b/openshift/templates/cleanup/cleanup-cron.yaml @@ -23,6 +23,7 @@ objects: metadata: creationTimestamp: null spec: + backoffLimit: 0 template: metadata: creationTimestamp: null @@ -84,7 +85,9 @@ objects: echo "==========> Removing expired pods" - oc -n $namespace get pods | grep -E "Completed|Error|ContainerStatusUnknown" | grep -v crunchy | grep -v spilo | grep -v backup | awk '{print $1}' | xargs oc -n $namespace delete pod || true + oc -n $namespace get pods | grep Completed | grep -v backup | awk '{print $1}' | xargs oc -n $namespace delete pod || true + + oc -n $namespace get pods | grep -E "Error|ContainerStatusUnknown" | grep -v crunchy | grep -v spilo | grep -v backup | awk '{print $1}' | xargs oc -n $namespace delete pod || true env=$(echo $namespace | awk -F '-' '{print $NF}') @@ -102,7 +105,7 @@ objects: done - restartPolicy: OnFailure + restartPolicy: Never terminationGracePeriodSeconds: 30 dnsPolicy: ClusterFirst securityContext: {}