Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "cap-app-proxy.fullname" . }}
annotations:
argocd.argoproj.io/sync-options: Delete=false
labels:
{{- include "cap-app-proxy.labels" . | nindent 4 }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ kind: Role
metadata:
labels:
app: cap-app-proxy
annotations:
argocd.argoproj.io/sync-options: Delete=false
name: cap-app-proxy
rules:
- apiGroups:
Expand All @@ -13,6 +15,7 @@ rules:
- secrets
- configmaps
- pods
- serviceaccounts
verbs:
- get
- create
Expand Down Expand Up @@ -77,6 +80,8 @@ kind: RoleBinding
metadata:
labels:
app: cap-app-proxy
annotations:
argocd.argoproj.io/sync-options: Delete=false
name: cap-app-proxy
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ metadata:
name: {{ include "cap-app-proxy.fullname" . }}-enrichment
labels:
{{- include "cap-app-proxy.labels" . | nindent 4 }}
annotations:
argocd.argoproj.io/sync-options: Delete=false
roleRef:
apiGroup: ""
kind: Role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
name: {{ include "cap-app-proxy.fullname" . }}-enrichment
labels:
{{- include "cap-app-proxy.labels" . | nindent 4 }}
annotations:
argocd.argoproj.io/sync-options: Delete=false
rules:
- apiGroups:
- "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
annotations:
helm.sh/hook: pre-delete
helm.sh/hook-weight: "5"
helm.sh/hook-delete-policy: hook-succeeded,before-hook-creation
helm.sh/hook-delete-policy: before-hook-creation
spec:
backoffLimit: 3
template:
Expand All @@ -20,10 +20,22 @@ spec:
command: ["sh", "-c"]
args:
- |
kubectl patch EventBus $(kubectl get eventbus -l codefresh.io/internal=true | awk 'NR>1{print $1}' | xargs) -p '{"metadata":{"finalizers":null}}' --type=merge && \
kubectl patch Eventsource $(kubectl get EventSource -l codefresh.io/internal=true | awk 'NR>1{print $1}' | xargs) -p '{"metadata":{"finalizers":null}}' --type=merge && \
kubectl patch Sensor $(kubectl get Sensor -l codefresh.io/internal=true | awk 'NR>1{print $1}' | xargs) -p '{"metadata":{"finalizers":null}}' --type=merge ;
return 0
set -e

echo "[cleanup] Namespace: {{ .Release.Namespace }}"

echo "[cleanup] Patching internal Argo CD Applications finalizers..."
kubectl get applications -n {{ .Release.Namespace }} -l codefresh.io/internal=true -o jsonpath='{.items[*].metadata.name}' \
| xargs -r -n1 -I{} sh -c 'echo "[cleanup] Patching application: {}"; kubectl patch application -n {{ .Release.Namespace }} {} -p '\''{"metadata":{"finalizers":null}}'\'' --type=merge' \
|| echo "[cleanup] Failed to patch applications (see errors above)"

echo "[cleanup] Deleting codefresh-token secret..."
kubectl delete secret codefresh-token -n {{ .Release.Namespace }} --ignore-not-found \
|| echo "[cleanup] Failed to delete codefresh-token (see errors above)"

echo "[cleanup] Deleting default git integration secrets..."
kubectl delete secret -n {{ .Release.Namespace }} -l 'io.codefresh.integration-type=git,io.codefresh.integration-name=default' --ignore-not-found \
|| echo "[cleanup] Failed to delete default git integration secrets (see errors above)"
{{- with .Values.installer.nodeSelector | default .Values.global.nodeSelector }}
nodeSelector: {{ toYaml . | nindent 8 }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions charts/gitops-runtime/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ argo-cd:
params:
server.insecure: true
application.namespaces: 'cf-*'
controller:
statefulsetAnnotations:
argocd.argoproj.io/sync-options: "Delete=false"
#-----------------------------------------------------------------------------------------------------------------------
# Argo Events
#-----------------------------------------------------------------------------------------------------------------------
Expand Down