Skip to content

Commit c48b0be

Browse files
authored
hypershift kubevirt: fetch the subscription channel from gangway API (#63139)
CNV (OpenShift Virtualization) now uses different OLM subscription channels in its catalog, and it is no longer only 'stable' as before. Fetch the subscription channel that has been passed through the Gangway API to trigger the prow job. Signed-off-by: Oren Cohen <ocohen@redhat.com>
1 parent 203233d commit c48b0be

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

ci-operator/step-registry/hypershift/kubevirt/install/hypershift-kubevirt-install-commands.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,18 @@ YQ="/tmp/yq"
1717
curl -L -o ${YQ} https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
1818
chmod +x ${YQ}
1919

20-
# Dynamically get CNV catalog image that was provided to the job via gangway API
20+
# Dynamically get CNV catalog image and channel that were provided to the job via gangway API
2121
CNV_PRERELEASE_CATALOG_IMAGE=$(curl -s https://prow.ci.openshift.org/prowjob?prowjob="${PROW_JOB_ID}" |\
2222
${YQ} e '.spec.pod_spec.containers[0].env[] | select(.name == "CNV_PRERELEASE_CATALOG_IMAGE") | .value')
23+
CNV_SUBSCRIPTION_CHANNEL=$(curl -s https://prow.ci.openshift.org/prowjob?prowjob="${PROW_JOB_ID}" |\
24+
${YQ} e '.spec.pod_spec.containers[0].env[] | select(.name == "CNV_CHANNEL") | .value')
2325

2426
if [ "${CNV_SUBSCRIPTION_SOURCE}" == "redhat-operators" ]
25-
then
26-
CNV_RELEASE_CHANNEL=stable
27-
elif [ -n "${CNV_PRERELEASE_CATALOG_IMAGE}" ]
28-
then
27+
then
2928
CNV_RELEASE_CHANNEL=stable
29+
elif [ -n "${CNV_PRERELEASE_CATALOG_IMAGE}" ] && [ -n "${CNV_SUBSCRIPTION_CHANNEL}" ]
30+
then
31+
CNV_RELEASE_CHANNEL=${CNV_SUBSCRIPTION_CHANNEL}
3032
else
3133
CNV_RELEASE_CHANNEL=nightly-$(ocp_version)
3234
CNV_PRERELEASE_CATALOG_IMAGE=quay.io/openshift-cnv/nightly-catalog:$(ocp_version)

ci-operator/step-registry/hypershift/kubevirt/install/odf/hypershift-kubevirt-install-odf-ref.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ref:
1111
env:
1212
- name: ODF_OPERATOR_CHANNEL
1313
documentation: The odf operator channel
14-
default: "stable-4.15"
14+
default: "stable-4.17"
1515
- name: ODF_SUBSCRIPTION_NAME
1616
documentation: The ODF/OCS subscription name
1717
default: "odf-operator"

ci-operator/step-registry/kubevirt/install/kubevirt-install-commands.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,18 @@ YQ="/tmp/yq"
1818
curl -L -o ${YQ} https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
1919
chmod +x ${YQ}
2020

21-
# Dynamically get CNV catalog image that was provided to the job via gangway API
21+
# Dynamically get CNV catalog image and channel that were provided to the job via gangway API
2222
CNV_PRERELEASE_CATALOG_IMAGE=$(curl -s https://prow.ci.openshift.org/prowjob?prowjob="${PROW_JOB_ID}" |\
2323
${YQ} e '.spec.pod_spec.containers[0].env[] | select(.name == "CNV_PRERELEASE_CATALOG_IMAGE") | .value')
24+
CNV_SUBSCRIPTION_CHANNEL=$(curl -s https://prow.ci.openshift.org/prowjob?prowjob="${PROW_JOB_ID}" |\
25+
${YQ} e '.spec.pod_spec.containers[0].env[] | select(.name == "CNV_CHANNEL") | .value')
2426

2527
if [ "${CNV_SUBSCRIPTION_SOURCE}" == "redhat-operators" ]
26-
then
27-
CNV_RELEASE_CHANNEL=stable
28-
elif [ -n "${CNV_PRERELEASE_CATALOG_IMAGE}" ]
29-
then
28+
then
3029
CNV_RELEASE_CHANNEL=stable
30+
elif [ -n "${CNV_PRERELEASE_CATALOG_IMAGE}" ] && [ -n "${CNV_SUBSCRIPTION_CHANNEL}" ]
31+
then
32+
CNV_RELEASE_CHANNEL=${CNV_SUBSCRIPTION_CHANNEL}
3133
else
3234
if [ "${CNV_PRERELEASE_LATEST_CHANNEL}" == "true" ]; then
3335
cnv_version=4.99

0 commit comments

Comments
 (0)