mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-22 21:46:02 -03:30
'/' doesn't work in kubernetes label so we replace it. Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>
18 lines
445 B
YAML
18 lines
445 B
YAML
---
|
|
|
|
- name: Fetch a list of namespaces
|
|
kubernetes.core.k8s_info:
|
|
api_version: v1
|
|
kind: Namespace
|
|
label_selectors:
|
|
- cijobs = true
|
|
- branch = {{ branch_name_sane }}
|
|
register: namespaces
|
|
|
|
- name: Delete older namespaces
|
|
command: "kubectl delete namespace {{ item.metadata.name }}"
|
|
failed_when: false
|
|
loop: "{{ namespaces.resources }}"
|
|
when:
|
|
- (item.metadata.labels.pipeline_id | int) < (pipeline_id | int)
|