Skip to content

Commit

Permalink
Rename keep resources job and delete old one (#49)
Browse files Browse the repository at this point in the history
* Rename keep resources job and delete old one
  • Loading branch information
sgalsaleh authored May 31, 2024
1 parent c719441 commit 1589102
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: batch/v1
kind: Job
metadata:
name: kotsadm-abandon-resources
name: kotsadm-keep-resources
annotations:
helm.sh/hook: pre-upgrade
helm.sh/hook-weight: "2"
Expand All @@ -20,6 +20,10 @@ spec:
- /bin/sh
- -c
- |
# Delete old abandon-resources job if it exists
kubectl delete job kotsadm-abandon-resources -n {{ .Release.Namespace }} --ignore-not-found
# Annotate resources to keep them
if kubectl get configmap kotsadm-confg -n {{ .Release.Namespace }} -o jsonpath='{.metadata.labels.app\.kubernetes\.io/managed-by}' | grep -q "Helm"; then
kubectl annotate configmap kotsadm-confg -n {{ .Release.Namespace }} helm.sh/resource-policy=keep
fi
Expand All @@ -33,7 +37,7 @@ spec:
{{- end }}
image: {{ .Values.images.kotsadm }}
imagePullPolicy: IfNotPresent
name: abandon-resources
name: keep-resources
resources:
requests:
cpu: 100m
Expand Down

0 comments on commit 1589102

Please sign in to comment.