forked from konflux-ci/release-service-catalog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: should not compare empty targetIndex (konflux-ci#560)
This commit fixes the situation when the targetIndex param is set to an empty value in the RPA, which is always the case for stagedIndex. The bug was introduced by the promotion required by the ticket RELEASE-1166. Signed-off-by: Leandro Mendes <[email protected]>
- Loading branch information
1 parent
e5eeb7b
commit 41f52bb
Showing
3 changed files
with
96 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
tasks/update-ocp-tag/tests/test-update-ocp-tag-staged-index.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
apiVersion: tekton.dev/v1 | ||
kind: Pipeline | ||
metadata: | ||
name: test-update-ocp-tag-staged-index | ||
spec: | ||
description: | | ||
Run the update-ocp-tag task with sample values | ||
and verify that all tags get updated to the new OCP version, except for the targetIndex when empty | ||
workspaces: | ||
- name: tests-workspace | ||
tasks: | ||
- name: setup | ||
workspaces: | ||
- name: data | ||
workspace: tests-workspace | ||
taskSpec: | ||
workspaces: | ||
- name: data | ||
steps: | ||
- name: setup-values | ||
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f | ||
script: | | ||
#!/usr/bin/env sh | ||
set -eux | ||
cat > $(workspaces.data.path)/data.json << EOF | ||
{ | ||
"fbc": { | ||
"fromIndex": "registry-proxy.engineering.redhat.com/rh-osbs/iib-preview-rhtap:{{ OCP_VERSION }}", | ||
"targetIndex": "", | ||
"stagedIndex": "true", | ||
"binaryImage": "registry.redhat.io/openshift4/ose-operator-registry:{{ OCP_VERSION }}" | ||
} | ||
} | ||
EOF | ||
- name: run-task | ||
taskRef: | ||
name: update-ocp-tag | ||
params: | ||
- name: dataPath | ||
value: data.json | ||
- name: ocpVersion | ||
value: "v4.13" | ||
workspaces: | ||
- name: data | ||
workspace: tests-workspace | ||
runAfter: | ||
- setup | ||
- name: check-result | ||
params: | ||
- name: updated-fromIndex | ||
value: $(tasks.run-task.results.updated-fromIndex) | ||
- name: updated-targetIndex | ||
value: $(tasks.run-task.results.updated-targetIndex) | ||
- name: updated-binaryImage | ||
value: $(tasks.run-task.results.updated-binaryImage) | ||
runAfter: | ||
- run-task | ||
taskSpec: | ||
params: | ||
- name: updated-fromIndex | ||
type: string | ||
- name: updated-targetIndex | ||
type: string | ||
- name: updated-binaryImage | ||
type: string | ||
steps: | ||
- name: check-result | ||
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f | ||
env: | ||
- name: "UPDATED_FROMINDEX" | ||
value: '$(params.updated-fromIndex)' | ||
- name: "UPDATED_TARGETINDEX" | ||
value: '$(params.updated-targetIndex)' | ||
- name: "UPDATED_BINARYIMAGE" | ||
value: '$(params.updated-binaryImage)' | ||
script: | | ||
#!/usr/bin/env sh | ||
set -eux | ||
echo "Validate all tags got updated to v4.13" | ||
test "$UPDATED_FROMINDEX" == \ | ||
"registry-proxy.engineering.redhat.com/rh-osbs/iib-preview-rhtap:v4.13" | ||
test "$UPDATED_BINARYIMAGE" == "registry.redhat.io/openshift4/ose-operator-registry:v4.13" | ||
test "$UPDATED_TARGETINDEX" == "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters