From 9dd173d6f242e790a4637f4a713a7a764d3bab61 Mon Sep 17 00:00:00 2001 From: Victoria Martinez de la Cruz Date: Fri, 1 Sep 2023 14:56:59 +0200 Subject: [PATCH 1/2] Add checks for not set sto and sgo bundle paths This change adds a check for whether sto and sgo bundle paths are defined and properly inform the user if they are undefined. Also sets the nightly builds available in Quay as defaults. --- build/stf-run-ci/README.md | 4 ++-- build/stf-run-ci/defaults/main.yml | 4 ++-- build/stf-run-ci/tasks/setup_stf_from_bundles.yml | 10 +++++++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/build/stf-run-ci/README.md b/build/stf-run-ci/README.md index a389d2c03..6b908d4f2 100644 --- a/build/stf-run-ci/README.md +++ b/build/stf-run-ci/README.md @@ -21,8 +21,8 @@ choose to override: | `__local_build_enabled` | {true,false} | true | Whether to deploy STF from local built artifacts. Also see `working_branch`, `sg_branch`, `sgo_branch` | | `__deploy_from_bundles_enabled` | {true,false} | false | Whether to deploy STF from OLM bundles (TODO: compat with `__local_build_enabled`) | | `__deploy_from_index_enabled` | {true,false} | false | Whether to deploy STF from locally built bundles and index image. | -| `__service_telemetry_bundle_image_path` | | | Image path to Service Telemetry Operator bundle | -| `__smart_gateway_bundle_image_path` | | | Image path to Smart Gateway Operator bundle | +| `__service_telemetry_bundle_image_path` | | `quay.io/infrawatch-operators/service-telemetry-operator-bundle:nightly-head` | Image path to Service Telemetry Operator bundle | +| `__smart_gateway_bundle_image_path` | | `quay.io/infrawatch-operators/smart-gateway-operator-bundle:nightly-head` | Image path to Smart Gateway Operator bundle | | `prometheus_webhook_snmp_branch` | | master | Which Prometheus Webhook SNMP git branch to checkout | | `sgo_branch` | | master | Which Smart Gateway Operator git branch to checkout | | `sg_core_branch` | | master | Which Smart Gateway Core git branch to checkout | diff --git a/build/stf-run-ci/defaults/main.yml b/build/stf-run-ci/defaults/main.yml index af263f7b8..7b51439b1 100644 --- a/build/stf-run-ci/defaults/main.yml +++ b/build/stf-run-ci/defaults/main.yml @@ -31,8 +31,8 @@ __service_telemetry_observability_strategy: use_redhat __service_telemetry_transports_certificates_endpoint_cert_duration: 70080h __service_telemetry_transports_certificates_ca_cert_duration: 70080h __internal_registry_path: image-registry.openshift-image-registry.svc:5000 -__service_telemetry_bundle_image_path: -__smart_gateway_bundle_image_path: +__service_telemetry_bundle_image_path: "quay.io/infrawatch-operators/service-telemetry-operator-bundle:nightly-head" +__smart_gateway_bundle_image_path: "quay.io/infrawatch-operators/smart-gateway-operator-bundle:nightly-head" default_operator_registry_image_base: registry.redhat.io/openshift4/ose-operator-registry default_operator_registry_image_tag: v4.12 diff --git a/build/stf-run-ci/tasks/setup_stf_from_bundles.yml b/build/stf-run-ci/tasks/setup_stf_from_bundles.yml index fd5423dd3..5d673d9ab 100644 --- a/build/stf-run-ci/tasks/setup_stf_from_bundles.yml +++ b/build/stf-run-ci/tasks/setup_stf_from_bundles.yml @@ -80,10 +80,18 @@ tags: - bundle_registry_tls_ca +- 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' + 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" + - name: Deploy SGO via OLM bundle shell: cmd: "{{ base_dir }}/working/operator-sdk run bundle {{__smart_gateway_bundle_image_path}} {% if pull_secret is defined %}--pull-secret-name=pull-secret --ca-secret-name=registry-tls-ca{% endif %} --namespace={{ namespace }} --timeout 600s" - name: Deploy STO via OLM bundle shell: - cmd: "{{ base_dir }}/working/operator-sdk run bundle {{ __service_telemetry_bundle_image_path}} {% if pull_secret is defined %}--pull-secret-name=pull-secret --ca-secret-name=registry-tls-ca{% endif %} --namespace={{ namespace }} --timeout 600s" + cmd: "{{ base_dir }}/working/operator-sdk run bundle {{ __service_telemetry_bundle_image_path}} {% if pull_secret is defined %}--pull-secret-name=pull-secret --ca-secret-name=registry-tls-ca{% endif %} --namespace={{ namespace }} --timeout 600s" \ No newline at end of file From cda1885adcccfcef93862a92bb0f5d6eddf3f43f Mon Sep 17 00:00:00 2001 From: Victoria Martinez de la Cruz Date: Fri, 1 Sep 2023 15:05:56 +0200 Subject: [PATCH 2/2] Re-add new line at the end of setup_stf_from_bundles.yml --- build/stf-run-ci/tasks/setup_stf_from_bundles.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/stf-run-ci/tasks/setup_stf_from_bundles.yml b/build/stf-run-ci/tasks/setup_stf_from_bundles.yml index 5d673d9ab..2e20ab726 100644 --- a/build/stf-run-ci/tasks/setup_stf_from_bundles.yml +++ b/build/stf-run-ci/tasks/setup_stf_from_bundles.yml @@ -94,4 +94,4 @@ - name: Deploy STO via OLM bundle shell: - cmd: "{{ base_dir }}/working/operator-sdk run bundle {{ __service_telemetry_bundle_image_path}} {% if pull_secret is defined %}--pull-secret-name=pull-secret --ca-secret-name=registry-tls-ca{% endif %} --namespace={{ namespace }} --timeout 600s" \ No newline at end of file + cmd: "{{ base_dir }}/working/operator-sdk run bundle {{ __service_telemetry_bundle_image_path}} {% if pull_secret is defined %}--pull-secret-name=pull-secret --ca-secret-name=registry-tls-ca{% endif %} --namespace={{ namespace }} --timeout 600s"