From a5ce98f4f307733cb9d8482e5d4fde888e6b28ab Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Wed, 29 Jan 2025 19:17:01 +0000 Subject: [PATCH] [common] Remove the CR update that adds the optional test It is addressed in a different commit --- roles/common/tasks/cr_tests.yml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/roles/common/tasks/cr_tests.yml b/roles/common/tasks/cr_tests.yml index 130e986c..03d05423 100644 --- a/roles/common/tasks/cr_tests.yml +++ b/roles/common/tasks/cr_tests.yml @@ -10,23 +10,14 @@ failed_when: - result.rc != 0 - # This is added so that the task name will be rendered correctly - # If item.condition_type is used and it doesn't exist, then the - # literal template text would appear as the task name - # e.g. "Verify that the {{ item.kind }} {{ item.name }} CR is {{ item.condition_type }}" - # and it would appear in the XML output incorrectly as - # "verify_that_the_item_kind_item_name_cr_is_item_condition_type" -- name: Set the condition type - ansible.builtin.set_fact: - condition_type: "{{ item.condition_type if item.condition_type is defined else '' }}" - -- name: | - {{ 'TEST' if condition_type | length > 0 }} Verify that the {{ item.kind }} {{ item.name }} CR is {{ condition_type }} - {{ common_cr_ready_test_id if condition_type | length > 0 }} +- name: Verify that a CR is ready {{ common_cr_ready_test_id }} ansible.builtin.command: cmd: | - oc get {{ item.kind }} {{ item.name }} -o jsonpath='{.status.conditions[?(@.type=="{{ condition_type }}")].status}{"\n"}' + oc get {{ item.kind }} {{ item.name }} -o jsonpath='{.status.conditions[?(@.type=="{{ item.condition_type }}")].status}{"\n"}' register: result changed_when: false failed_when: - result.stdout != "True" + when: + - common_cr_ready_test_id is defined + - item.condition_type is defined