Skip to content

Commit

Permalink
Merge pull request #72 from robertchoi80/main
Browse files Browse the repository at this point in the history
add step to remove leftover resources in lma
  • Loading branch information
zugwan authored Feb 24, 2022
2 parents e579a9a + a1643c2 commit 9aa22fa
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions templates/argo-additional-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ rules:
- ""
resources:
- secrets
- persistentvolumeclaims
verbs:
- get
- create
Expand Down
4 changes: 2 additions & 2 deletions templates/argo-cd/delete-apps-by-label-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ spec:
if [[ $? -eq 0 && -n $app_list ]]; then
echo "Found apps with label '$FILTER'.. Start deleting apps.."
else
echo "No such label: $FILTER. Exiting.."
exit 1
echo "No such label: $FILTER. Skipping app removal.."
exit 0
fi
deleted=False
Expand Down
22 changes: 22 additions & 0 deletions templates/decapod-apps/remove-lma-uniformed-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,25 @@ spec:
parameters:
- name: filter
value: "{{ workflow.parameters.filter }}"

# LMA appGroup specific task #
- - name: cleanupLeftoverResources
template: removeLeftoverResources
arguments:
parameters:
- name: namespace
value: "lma"

- name: removeLeftoverResources
inputs:
parameters:
- name: namespace
container:
name: remove-leftover
image: 'k8s.gcr.io/hyperkube:v1.18.6'
command:
- /bin/bash
- '-c'
- |
kubectl delete secret etcd-client-cert prometheus-operator-admission -n {{inputs.parameters.namespace}} || true
kubectl delete pvc --all -n {{inputs.parameters.namespace}}

0 comments on commit 9aa22fa

Please sign in to comment.