Skip to content

Commit 796909f

Browse files
added clean up for codefresh secret and git integration
1 parent 0bd90e7 commit 796909f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

charts/gitops-runtime/templates/hooks/pre-uninstall/cleanup-resources.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,15 @@ spec:
2020
command: ["sh", "-c"]
2121
args:
2222
- |
23+
# Remove finalizers from internal Argo CD Applications in this runtime namespace
2324
kubectl get applications -n {{ .Release.Namespace }} -l codefresh.io/internal=true -o jsonpath='{.items[*].metadata.name}' \
2425
| xargs -r -n1 -I{} kubectl patch application -n {{ .Release.Namespace }} {} -p '{"metadata":{"finalizers":null}}' --type=merge || true
26+
27+
# Delete runtime token secret in this namespace (if present)
28+
kubectl delete secret codefresh-token -n {{ .Release.Namespace }} --ignore-not-found || true
29+
30+
# Delete default git integration secret in this namespace (if present)
31+
kubectl delete secret -n {{ .Release.Namespace }} -l 'io.codefresh.integration-type=git,io.codefresh.integration-name=default' --ignore-not-found || true
2532
{{- with .Values.installer.nodeSelector | default .Values.global.nodeSelector }}
2633
nodeSelector: {{ toYaml . | nindent 8 }}
2734
{{- end }}

0 commit comments

Comments
 (0)