Skip to content

Commit fff14b0

Browse files
michburkopenshift-merge-bot[bot]
authored andcommitted
[discover_latest_image] Don't set single-image facts to null
Setting the single-image facts to `null` broke some `when` conditions that expected the facts to be completely unset. Signed-off-by: Michael Burke <michburk@redhat.com>
1 parent cee62cd commit fff14b0

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

roles/discover_latest_image/molecule/default/converge.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@
9090
- item.value.hash_algorithm is defined
9191
loop: "{{ cifmw_discovered_images_dict | dict2items }}"
9292

93-
- name: Ensure single-image facts are null when no default entry
93+
- name: Ensure single-image facts are unchanged
9494
ansible.builtin.assert:
9595
that:
96-
- cifmw_discovered_image_name is none
97-
- cifmw_discovered_image_url is none
98-
- cifmw_discovered_hash is none
99-
- cifmw_discovered_hash_algorithm is none
96+
- "'CentOS-Stream-GenericCloud-x86_64-10' in cifmw_discovered_image_name"
97+
- cifmw_discovered_image_url is not none
98+
- cifmw_discovered_hash is not none
99+
- cifmw_discovered_hash_algorithm is not none
100100

101101
- name: Test multi-image discovery with default entry
102102
hosts: all

roles/discover_latest_image/tasks/main.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,9 @@
1414
# License for the specific language governing permissions and limitations
1515
# under the License.
1616

17-
- name: Set the discovered image vars to empty/null
17+
- name: Set the discovered images dict to empty
1818
ansible.builtin.set_fact:
1919
cifmw_discovered_images_dict: {}
20-
cifmw_discovered_image_name: null
21-
cifmw_discovered_image_url: null
22-
cifmw_discovered_hash: null
23-
cifmw_discovered_hash_algorithm: null
2420

2521
- name: Discover images
2622
ansible.builtin.include_tasks: per-image.yml

0 commit comments

Comments
 (0)