Skip to content

Commit 694642e

Browse files
committed
[ISV-2647] Fix how supported index lists are passed
The solves a problem with trailing slashes seen on the index image pull specs in the publish-bundle task. It removes the prior workaround.
1 parent c65ae35 commit 694642e

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

ansible/roles/operator-pipeline/templates/openshift/pipelines/operator-release-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ spec:
429429
params:
430430
- name: pipeline_image
431431
value: "$(params.pipeline_image)"
432-
- name: bundle_versions
432+
- name: index_images
433433
value: "$(tasks.get-supported-versions.results.indices)"
434434
- name: bundle_pullspec
435435
value: "$(tasks.publish-to-ocp-registry.results.image_pullspec)"

ansible/roles/operator-pipeline/templates/openshift/tasks/check-ocp-cluster-version.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ spec:
77
params:
88
- name: pipeline_image
99
- name: indices_ocp_versions
10-
description: All known supported OCP indices' OCP versions
10+
description: All known supported OCP versions (space separated)
1111
- name: kubeconfig_secret_name
1212
description: The name of the Kubernetes Secret that contains the kubeconfig.
1313
- name: kubeconfig_secret_key
@@ -31,14 +31,8 @@ spec:
3131
CLUSTER_VERSION=$(oc get clusterversion -o jsonpath="{.items[0].status.desired.version}" --kubeconfig $KUBECONFIG)
3232
# Grab only the major and minor version for comparison
3333
CLUSTER_VERSION=$(echo $CLUSTER_VERSION | cut -d. -f1,2)
34-
# parse indices into a list of strings with OCP versions
35-
# The base64 step here is part of the workaround for
36-
# https://github.com/tektoncd/pipeline/issues/5414 affecting new tekton
37-
# pipelines versions (Openshift Pipelines Operator v1.8)
38-
RAW_INDICES_OCP_VERSIONS=$(echo '$(params.indices_ocp_versions)' | base64 -d)
39-
SUPPORTED_VERSIONS=$(echo "$RAW_INDICES_OCP_VERSIONS" | jq -r '.[]')
4034
41-
for version in $SUPPORTED_VERSIONS; do
35+
for version in $(params.indices_ocp_versions); do
4236
if [ "$version" == "$CLUSTER_VERSION" ]; then
4337
echo "The Operator does claim support for the provided cluster version ($CLUSTER_VERSION)."
4438
exit 0

ansible/roles/operator-pipeline/templates/openshift/tasks/get-supported-versions.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,14 @@ spec:
99
- name: bundle_path
1010
description: path indicating the location of the certified bundle within the repository
1111
results:
12-
# NOTE: as a workaround for https://github.com/tektoncd/pipeline/issues/5414
13-
# that affects recent versions of Tekton Pipelines, including the version
14-
# shipped with Openshift Pipelines 1.8, all results containing JSON payload
15-
# have been changed to be base64 encoded
1612
- name: max_supported_ocp_version
1713
description: Maximum version of OpenShift supported by this Operator
1814
- name: max_supported_index
1915
description: Pull spec for the index corresponding to the max OCP version
2016
- name: indices
21-
description: All known supported OCP indices paths (base64 encoded, see NOTE)
17+
description: All known supported index image pull specs (space separated)
2218
- name: indices_ocp_versions
23-
description: All known supported OCP indices' OCP version (base64 encoded, see NOTE)s
19+
description: All known supported OCP versions (space separated)
2420
- name: max_version_indices
2521
description: Latest known supported OCP indices
2622
- name: ocp_version
@@ -50,15 +46,13 @@ spec:
5046
| tee $(results.max_supported_index.path)
5147
5248
echo $VERSION_INFO \
53-
| jq -r '[.indices[].path]' \
49+
| jq -r '.indices | map(.path) | join(" ")' \
5450
| tr -d '\n\r' \
55-
| base64 \
5651
| tee $(results.indices.path)
5752
5853
echo $VERSION_INFO \
59-
| jq -r '[.indices[].ocp_version]' \
54+
| jq -r '.indices | map(.ocp_version) | join(" ")' \
6055
| tr -d '\n\r' \
61-
| base64 \
6256
| tee $(results.indices_ocp_versions.path)
6357
6458
echo $VERSION_INFO \

ansible/roles/operator-pipeline/templates/openshift/tasks/publish-bundle.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ spec:
88
- name: pipeline_image
99
- name: bundle_pullspec
1010
description: Bundle pullspec
11-
- name: bundle_versions
12-
description: All known supported OCP indices
11+
- name: index_images
12+
description: All known supported index image pull specs (space separated)
1313
- name: iib_url
1414
description: IIB API url
1515
default: https://iib.engineering.redhat.com
@@ -99,17 +99,11 @@ spec:
9999
;;
100100
esac
101101
102-
# The base64 step here is part of the workaround for
103-
# https://github.com/tektoncd/pipeline/issues/5414 affecting new tekton
104-
# pipelines versions (Openshift Pipelines Operator v1.8)
105-
RAW_BUNDLE_VERSIONS=$(echo '$(params.bundle_versions)' | base64 -d)
106-
INDICES="$(echo "$RAW_BUNDLE_VERSIONS" | tr -d '[,]')"
107-
108102
# DO NOT use `--verbose` to avoid auth headers appearing in logs
109103
index \
110104
--iib-url "$(params.iib_url)" \
111105
--from-index $FROM_INDEX \
112-
--indices $INDICES \
106+
--indices $(params.index_images) \
113107
--bundle-pullspec "$(params.bundle_pullspec)" \
114108
--output manifest-list-digests.txt
115109

docs/ci-cd.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,21 @@ ansible-pull \
6262
--vault-password-file $VAULT_PASSWORD_PATH \
6363
ansible/playbooks/operator-pipeline-integration-tests.yml
6464
```
65+
66+
It may be necessary to provide your own project and bundle to test certain
67+
aspects of the pipelines. This can be accomplished with the addition of a few
68+
extra vars (and proper configuration of the project).
69+
70+
```bash
71+
ansible-pull \
72+
-U "https://github.com/redhat-openshift-ecosystem/operator-pipelines.git" \
73+
-i "ansible/inventory/operator-pipeline-integration-tests" \
74+
-e "oc_namespace=$NAMESPACE" \
75+
-e "src_operator_git_branch=$SRC_BRANCH" \
76+
-e "src_operator_bundle_version=$SRC_VERSION" \
77+
-e "operator_package_name=$PACKAGE_NAME" \
78+
-e "operator_bundle_version=$NEW_VERSION" \
79+
-e "ci_pipeline_pyxis_api_key=$API_KEY" \
80+
--vault-password-file $VAULT_PASSWORD_PATH \
81+
ansible/playbooks/operator-pipeline-integration-tests.yml
82+
```

0 commit comments

Comments
 (0)