Refactor e2e-cron.yml to include common environment variables and change restart policy

This commit is contained in:
Simon Larsen 2024-04-25 12:33:58 +01:00
parent ef0dc5305a
commit 73e6a20503
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE

View File

@ -16,18 +16,5 @@ spec:
- name: e2e-cron
image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "e2e" $.Values.image.tag }}
env:
- name: BASE_URL
value: {{ $.Release.Namespace }}
command:
- /bin/bash
- -c
- |
for pod in $(kubectl get pods -n $namespace --field-selector=status.phase==Failed -o jsonpath="{.items[*].metadata.name}")
do
if kubectl describe pod $pod -n $namespace | grep -q 'CrashLoopBackOff'
then
kubectl delete pod $pod -n $namespace
fi
done
restartPolicy: OnFailure
{{- include "oneuptime.env.common" . | nindent 14 }}
restartPolicy: Never