Skip to content

Commit

Permalink
update cleanup cron
Browse files Browse the repository at this point in the history
  • Loading branch information
kuanfandevops committed May 27, 2024
1 parent 53f2b12 commit abe1730
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions openshift/templates/cleanup/cleanup-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ objects:
metadata:
creationTimestamp: null
spec:
backoffLimit: 0
template:
metadata:
creationTimestamp: null
Expand Down Expand Up @@ -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}')
Expand All @@ -102,7 +105,7 @@ objects:
done
restartPolicy: OnFailure
restartPolicy: Never
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
Expand Down

0 comments on commit abe1730

Please sign in to comment.