Only delete namespaces of specific installation with Ansible
There existed a bug using the Ansible uninstaller that would clear out
all namespaces that had the "vendor=crunchydata" label, and not accounting
for the "pgo-installation-name" label.
This ensures the Ansible uninstaller checks for this label.
Issue: [ch6725]
- name: Find watched namespaces
shell: |
- {{ kubectl_or_oc }} get namespaces -o json --selector=vendor=crunchydata
+ {{ kubectl_or_oc }} get namespaces -o json --selector=vendor=crunchydata,pgo-installation-name={{ pgo_installation_name }}
register: ns_result
tags:
- uninstall
shell: |
{{ kubectl_or_oc }} label namespace {{ item }} vendor- pgo-created-by- pgo-installation-name-
ignore_errors: yes
+ when: not (delete_watched_namespaces|bool)
with_items:
- "{{ watched_namespaces }}"
no_log: false
