mirror of
https://github.com/ansible/awx-operator.git
synced 2026-03-26 21:33:14 +00:00
Updating awx_test.yml to respect both web and task deployments.
- Extracts label information from both web and task pods - Asserts web and task pod labels are correct respectively
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
register: admin_pw_secret
|
||||
|
||||
- block:
|
||||
- name: Get pod details
|
||||
- name: Get web pod details
|
||||
k8s_info:
|
||||
namespace: '{{ namespace }}'
|
||||
kind: Pod
|
||||
@@ -28,6 +28,15 @@
|
||||
register: awx_pod
|
||||
when: not awx_version
|
||||
|
||||
- name: Get task pod details
|
||||
k8s_info:
|
||||
namespace: '{{ namespace }}'
|
||||
kind: Pod
|
||||
label_selectors:
|
||||
- app.kubernetes.io/name = example-awx-task
|
||||
register: awx_task_pod
|
||||
when: not awx_version
|
||||
|
||||
- name: Extract tags from images
|
||||
set_fact:
|
||||
image_tags: |
|
||||
@@ -108,8 +117,14 @@
|
||||
| dict2items | selectattr('key', 'in', this_awx.resources[0].spec.additional_labels)
|
||||
| list
|
||||
}}
|
||||
|
||||
- name: Extract additional_labels from AWX Pod
|
||||
- name: Extract additional_labels from AWX Task spec
|
||||
set_fact:
|
||||
awx_task_pod_additional_labels: >-
|
||||
{{ this_awx.resources[0].metadata.labels
|
||||
| dict2items | selectattr('key', 'in', this_awx.resources[0].spec.additional_labels)
|
||||
| list
|
||||
}}
|
||||
- name: Extract additional_labels from AWX Web Pod
|
||||
set_fact:
|
||||
pod_additional_labels: >-
|
||||
{{ awx_pod.resources[0].metadata.labels
|
||||
@@ -117,11 +132,24 @@
|
||||
| list
|
||||
}}
|
||||
|
||||
- name: AWX Pod contains additional_labels
|
||||
- name: Extract additional_labels from AWX Task Pod
|
||||
set_fact:
|
||||
task_pod_additional_labels: >-
|
||||
{{ awx_task_pod.resources[0].metadata.labels
|
||||
| dict2items | selectattr('key', 'in', this_awx.resources[0].spec.additional_labels)
|
||||
| list
|
||||
}}
|
||||
|
||||
- name: AWX Web Pod contains additional_labels
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- pod_additional_labels == awx_additional_labels
|
||||
|
||||
- name: AWX Task Pod contains additional_labels
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- task_pod_additional_labels == awx_task_pod_additional_labels
|
||||
|
||||
- name: Extract Pod labels which shouldn't have been propagated to it from AWX
|
||||
set_fact:
|
||||
pod_extra_labels: >-
|
||||
|
||||
Reference in New Issue
Block a user