-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(KFLUXBUGS-1639): task can't get ocp version of multiarch images (#…
…559) this commit fixes the condition when a fbc fragment is a catalog for a multi platform component. Signed-off-by: Leandro Mendes <[email protected]>
- Loading branch information
1 parent
1d11b05
commit 37e5e1d
Showing
5 changed files
with
105 additions
and
8 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
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
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,24 @@ | ||
#!/usr/bin/env bash | ||
set -eux | ||
|
||
function oras() { | ||
echo "sha256:manifest" | ||
} | ||
|
||
function skopeo() { | ||
if [[ "$*" == "inspect --raw docker://quay.io/fbc/multi-arch@sha256:index" ]]; then | ||
echo '{ "mediaType": "application/vnd.oci.image.index.v1+json" }' | ||
else | ||
echo '{ "mediaType": "application/vnd.oci.image.manifest.v1+json", | ||
"annotations": { | ||
"org.opencontainers.image.base.digest": "sha256:manifest", | ||
"org.opencontainers.image.base.name": "registry.redhat.io/openshift4/ose-operator-registry-rhel9:v4.12" | ||
} | ||
}' | ||
fi | ||
} | ||
|
||
function get-image-architectures() { | ||
echo '{"platform":{"digest": "sha256:manifest", "architecture": "amd64", "os": "linux"}}' | ||
echo '{"platform":{"digest": "sha256:manifest", "architecture": "ppc64le", "os": "linux"}}' | ||
} |
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,7 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Add mocks to the beginning of task step script | ||
TASK_PATH="$1" | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
yq -i '.spec.steps[0].script = load_str("'$SCRIPT_DIR'/mocks.sh") + .spec.steps[0].script' "$TASK_PATH" |
39 changes: 39 additions & 0 deletions
39
tasks/get-ocp-version/tests/test-get-ocp-version-multi-arch.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,39 @@ | ||
--- | ||
apiVersion: tekton.dev/v1 | ||
kind: Pipeline | ||
metadata: | ||
name: test-get-ocp-version-multi-arch | ||
spec: | ||
description: | | ||
Run the get-ocp-version task with a multi-arch fbcFragment FBC Image | ||
and verify that OCP-Version is been stored as expected | ||
workspaces: | ||
- name: tests-workspace | ||
tasks: | ||
- name: run-task | ||
taskRef: | ||
name: get-ocp-version | ||
params: | ||
- name: fbcFragment | ||
value: quay.io/fbc/multi-arch@sha256:index | ||
- name: check-result | ||
params: | ||
- name: stored-version | ||
value: $(tasks.run-task.results.stored-version) | ||
runAfter: | ||
- run-task | ||
taskSpec: | ||
params: | ||
- name: stored-version | ||
steps: | ||
- name: check-result | ||
image: quay.io/konflux-ci/release-service-utils:e633d51cd41d73e4b3310face21bb980af7a662f | ||
env: | ||
- name: "OCP_VERSION" | ||
value: '$(params.stored-version)' | ||
script: | | ||
#!/usr/bin/env sh | ||
set -eux | ||
echo "Task result contains the valid OCP version number" | ||
test $(echo $OCP_VERSION) == "v4.12" |