Merge pull request #1327 from djyasin/1315_Update-tests-to-validate-web-task

Updating awx_test.yml to respect both web and task deployments.
This commit is contained in:
Lila Yasin
2023-04-07 10:51:02 -04:00
committed by GitHub

View File

@@ -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: >-