Skip to content

Commit

Permalink
[stf-run-ci] Update validation check for bundle URLs
Browse files Browse the repository at this point in the history
An empty string passed as the bundle URL will pass the existing test
of "is defined" and "is not None" and still be invalid.

* add a check for "length != 0"
* assert requires all conditions to be met, the checks can all be listed
  separately to make the task easier to grok.
  • Loading branch information
elfiesmelfie committed Jan 31, 2024
1 parent f900181 commit b365236
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions build/stf-run-ci/tasks/setup_stf_from_bundles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,14 @@
- name: "Ensure that the bundle paths are set."
ansible.builtin.assert:
that:
- '__smart_gateway_bundle_image_path is defined and __smart_gateway_bundle_image_path != None'
- '__service_telemetry_bundle_image_path is defined and __service_telemetry_bundle_image_path != None'
- '__smart_gateway_bundle_image_path is defined'
- '__smart_gateway_bundle_image_path != None'
- '__smart_gateway_bundle_image_path | length != 0'
- '__service_telemetry_bundle_image_path is defined'
- '__service_telemetry_bundle_image_path != None'
- '__service_telemetry_bindle_image_path | length != 0'
fail_msg: "Bundle path(s) not set. __smart_gateway_bundle_image_path is '{{ __smart_gateway_bundle_image_path }}' and __service_telemetry_bundle_image_path is '{{ __service_telemetry_bundle_image_path }}'. Both values need to be set."
success_msg: "Bundle paths are defined and not None"
success_msg: "Bundle paths are defined, are not None and have a non-zero-length"

- name: Deploy SGO via OLM bundle
ansible.builtin.shell:
Expand Down

0 comments on commit b365236

Please sign in to comment.