Skip to content

Commit

Permalink
Merge branch 'main' into bump-1.36
Browse files Browse the repository at this point in the history
  • Loading branch information
pierDipi committed Jan 17, 2025
2 parents 814fd37 + e6beb76 commit 3c94bda
Show file tree
Hide file tree
Showing 17 changed files with 141 additions and 47 deletions.
14 changes: 7 additions & 7 deletions .tekton/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ spec:
- name: name
value: sast-snyk-check-oci-ta
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-sast-snyk-check-oci-ta:0.3@sha256:6d232347739a0366dcfc4e40afbcb5d1937dd3fea8952afb1bd6a4b0c5d1c1f5
value: quay.io/konflux-ci/tekton-catalog/task-sast-snyk-check-oci-ta:0.3@sha256:af93b35e6e71a6ff7f3785ad8d8497b11204a5c0c33ab1a78b44f9d43f49c7a5
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -277,7 +277,7 @@ spec:
- name: name
value: buildah-remote-oci-ta
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-buildah-remote-oci-ta:0.2@sha256:a6299007879d8356a390ec1d99a2e5988d4eb2376c03472f99c55c369a13e749
value: quay.io/konflux-ci/tekton-catalog/task-buildah-remote-oci-ta:0.3@sha256:6c2c433ef94187e9aa73575004029cd6e2bbbdeefc7f90070595fb20f77bc121
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -356,7 +356,7 @@ spec:
- name: name
value: deprecated-image-check
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-deprecated-image-check:0.4@sha256:f8efb0b22692fad908a1a75f8d5c0b6ed3b0bcd2a9853577e7be275e5bac1bb8
value: quay.io/konflux-ci/tekton-catalog/task-deprecated-image-check:0.4@sha256:650330fde0773f73f6bac77ae573031c44c79165d9503b0d5ec1db3e6ef981d7
- name: kind
value: task
resolver: bundles
Expand All @@ -378,7 +378,7 @@ spec:
- name: name
value: clair-scan
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-clair-scan:0.2@sha256:e428b37d253621365ffb24d4053e5f3141988ae6a30fce1c8ba73b7211396eb0
value: quay.io/konflux-ci/tekton-catalog/task-clair-scan:0.2@sha256:907f11c67b0330480cbf85c23b1085acc5a049ab90af980169251860a3d97ef7
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -420,7 +420,7 @@ spec:
- name: name
value: clamav-scan
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-clamav-scan:0.2@sha256:d78221853f7ff2befc6669dd0eeb91e6611ae84ac7754150ea0f071d92ff41cb
value: quay.io/konflux-ci/tekton-catalog/task-clamav-scan:0.2@sha256:c12e7a774bb07ad2796c01071b0dc0f199111b0ee99c45b55fa599e23b200bae
- name: kind
value: task
resolver: bundles
Expand All @@ -446,7 +446,7 @@ spec:
- name: name
value: sast-shell-check-oci-ta
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-sast-shell-check-oci-ta:0.1@sha256:ac6a35e4143a68f841e363da3f21f2123de9f3acf76596f79ecb60c501eed408
value: quay.io/konflux-ci/tekton-catalog/task-sast-shell-check-oci-ta:0.1@sha256:7553ec6925d0586b286502669b8e31a39dc73501f657426bac99019ac598d6ab
- name: kind
value: task
resolver: bundles
Expand All @@ -470,7 +470,7 @@ spec:
- name: name
value: sast-shell-check-oci-ta
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-sast-shell-check-oci-ta:0.1@sha256:ac6a35e4143a68f841e363da3f21f2123de9f3acf76596f79ecb60c501eed408
value: quay.io/konflux-ci/tekton-catalog/task-sast-shell-check-oci-ta:0.1@sha256:7553ec6925d0586b286502669b8e31a39dc73501f657426bac99019ac598d6ab
- name: kind
value: task
resolver: bundles
Expand Down
6 changes: 3 additions & 3 deletions .tekton/fbc-builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ spec:
- name: name
value: buildah-remote-oci-ta
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-buildah-remote-oci-ta:0.2@sha256:a6299007879d8356a390ec1d99a2e5988d4eb2376c03472f99c55c369a13e749
value: quay.io/konflux-ci/tekton-catalog/task-buildah-remote-oci-ta:0.3@sha256:6c2c433ef94187e9aa73575004029cd6e2bbbdeefc7f90070595fb20f77bc121
- name: kind
value: task
resolver: bundles
Expand Down Expand Up @@ -290,7 +290,7 @@ spec:
- name: name
value: deprecated-image-check
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-deprecated-image-check:0.4@sha256:f8efb0b22692fad908a1a75f8d5c0b6ed3b0bcd2a9853577e7be275e5bac1bb8
value: quay.io/konflux-ci/tekton-catalog/task-deprecated-image-check:0.4@sha256:650330fde0773f73f6bac77ae573031c44c79165d9503b0d5ec1db3e6ef981d7
- name: kind
value: task
resolver: bundles
Expand All @@ -312,7 +312,7 @@ spec:
- name: name
value: validate-fbc
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-validate-fbc:0.1@sha256:4348a28a109daeab3af9515120e6332eb3c2af2020b96a54afc2365b6c7703ed
value: quay.io/konflux-ci/tekton-catalog/task-validate-fbc:0.1@sha256:13d618f82e8ee8877dada8e1c56e1a7a69b6810290a88821d39c5790c3511e27
- name: kind
value: task
resolver: bundles
Expand Down
1 change: 1 addition & 0 deletions .tekton/serverless-bundle-136-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ metadata:
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main" && ( files.all.exists(x, x.matches('^olm-catalog/serverless-operator/')) || files.all.exists(x, x.matches('^.tekton/')) )
build.appstudio.openshift.io/build-nudge-files: ".*Dockerfile.*,olm-catalog/.*.yaml,olm-catalog/.*.yml,.*Containerfile.*"
creationTimestamp: null
labels:
appstudio.openshift.io/application: serverless-operator-136
Expand Down
1 change: 1 addition & 0 deletions .tekton/serverless-bundle-136-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ metadata:
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "main" && ( files.all.exists(x, x.matches('^olm-catalog/serverless-operator/')) || files.all.exists(x, x.matches('^.tekton/')) )
build.appstudio.openshift.io/build-nudge-files: ".*Dockerfile.*,olm-catalog/.*.yaml,olm-catalog/.*.yml,.*Containerfile.*"
creationTimestamp: null
labels:
appstudio.openshift.io/application: serverless-operator-136
Expand Down
3 changes: 2 additions & 1 deletion .tekton/serverless-ingress-136-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ metadata:
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main" && ( files.all.exists(x, !x.matches('^olm-catalog/')) && files.all.exists(x, !x.matches('^.konflux-release/')) )
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main" && files.all.exists(x, !x.matches('^olm-catalog/') && !x.matches('^.konflux-release/'))
build.appstudio.openshift.io/build-nudge-files: ".*Dockerfile.*,olm-catalog/.*.yaml,olm-catalog/.*.yml,.*Containerfile.*"
creationTimestamp: null
labels:
appstudio.openshift.io/application: serverless-operator-136
Expand Down
3 changes: 2 additions & 1 deletion .tekton/serverless-ingress-136-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ metadata:
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "main" && ( files.all.exists(x, !x.matches('^olm-catalog/')) && files.all.exists(x, !x.matches('^.konflux-release/')) )
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "main" && files.all.exists(x, !x.matches('^olm-catalog/') && !x.matches('^.konflux-release/'))
build.appstudio.openshift.io/build-nudge-files: ".*Dockerfile.*,olm-catalog/.*.yaml,olm-catalog/.*.yml,.*Containerfile.*"
creationTimestamp: null
labels:
appstudio.openshift.io/application: serverless-operator-136
Expand Down
3 changes: 2 additions & 1 deletion .tekton/serverless-kn-operator-136-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ metadata:
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main" && ( files.all.exists(x, !x.matches('^olm-catalog/')) && files.all.exists(x, !x.matches('^.konflux-release/')) )
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main" && files.all.exists(x, !x.matches('^olm-catalog/') && !x.matches('^.konflux-release/'))
build.appstudio.openshift.io/build-nudge-files: ".*Dockerfile.*,olm-catalog/.*.yaml,olm-catalog/.*.yml,.*Containerfile.*"
creationTimestamp: null
labels:
appstudio.openshift.io/application: serverless-operator-136
Expand Down
3 changes: 2 additions & 1 deletion .tekton/serverless-kn-operator-136-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ metadata:
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "main" && ( files.all.exists(x, !x.matches('^olm-catalog/')) && files.all.exists(x, !x.matches('^.konflux-release/')) )
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "main" && files.all.exists(x, !x.matches('^olm-catalog/') && !x.matches('^.konflux-release/'))
build.appstudio.openshift.io/build-nudge-files: ".*Dockerfile.*,olm-catalog/.*.yaml,olm-catalog/.*.yml,.*Containerfile.*"
creationTimestamp: null
labels:
appstudio.openshift.io/application: serverless-operator-136
Expand Down
3 changes: 2 additions & 1 deletion .tekton/serverless-metadata-webhook-136-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ metadata:
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main" && ( files.all.exists(x, !x.matches('^olm-catalog/')) && files.all.exists(x, !x.matches('^.konflux-release/')) )
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main" && files.all.exists(x, !x.matches('^olm-catalog/') && !x.matches('^.konflux-release/'))
build.appstudio.openshift.io/build-nudge-files: ".*Dockerfile.*,olm-catalog/.*.yaml,olm-catalog/.*.yml,.*Containerfile.*"
creationTimestamp: null
labels:
appstudio.openshift.io/application: serverless-operator-136
Expand Down
3 changes: 2 additions & 1 deletion .tekton/serverless-metadata-webhook-136-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ metadata:
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "main" && ( files.all.exists(x, !x.matches('^olm-catalog/')) && files.all.exists(x, !x.matches('^.konflux-release/')) )
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "main" && files.all.exists(x, !x.matches('^olm-catalog/') && !x.matches('^.konflux-release/'))
build.appstudio.openshift.io/build-nudge-files: ".*Dockerfile.*,olm-catalog/.*.yaml,olm-catalog/.*.yml,.*Containerfile.*"
creationTimestamp: null
labels:
appstudio.openshift.io/application: serverless-operator-136
Expand Down
3 changes: 2 additions & 1 deletion .tekton/serverless-must-gather-136-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ metadata:
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main" && ( files.all.exists(x, !x.matches('^olm-catalog/')) && files.all.exists(x, !x.matches('^.konflux-release/')) )
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main" && files.all.exists(x, !x.matches('^olm-catalog/') && !x.matches('^.konflux-release/'))
build.appstudio.openshift.io/build-nudge-files: ".*Dockerfile.*,olm-catalog/.*.yaml,olm-catalog/.*.yml,.*Containerfile.*"
creationTimestamp: null
labels:
appstudio.openshift.io/application: serverless-operator-136
Expand Down
3 changes: 2 additions & 1 deletion .tekton/serverless-must-gather-136-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ metadata:
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "main" && ( files.all.exists(x, !x.matches('^olm-catalog/')) && files.all.exists(x, !x.matches('^.konflux-release/')) )
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "main" && files.all.exists(x, !x.matches('^olm-catalog/') && !x.matches('^.konflux-release/'))
build.appstudio.openshift.io/build-nudge-files: ".*Dockerfile.*,olm-catalog/.*.yaml,olm-catalog/.*.yml,.*Containerfile.*"
creationTimestamp: null
labels:
appstudio.openshift.io/application: serverless-operator-136
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ metadata:
build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main" && ( files.all.exists(x, !x.matches('^olm-catalog/')) && files.all.exists(x, !x.matches('^.konflux-release/')) )
pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch == "main" && files.all.exists(x, !x.matches('^olm-catalog/') && !x.matches('^.konflux-release/'))
build.appstudio.openshift.io/build-nudge-files: ".*Dockerfile.*,olm-catalog/.*.yaml,olm-catalog/.*.yml,.*Containerfile.*"
creationTimestamp: null
labels:
appstudio.openshift.io/application: serverless-operator-136
Expand Down
3 changes: 2 additions & 1 deletion .tekton/serverless-openshift-kn-operator-136-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ metadata:
build.appstudio.redhat.com/commit_sha: '{{revision}}'
build.appstudio.redhat.com/target_branch: '{{target_branch}}'
pipelinesascode.tekton.dev/max-keep-runs: "3"
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "main" && ( files.all.exists(x, !x.matches('^olm-catalog/')) && files.all.exists(x, !x.matches('^.konflux-release/')) )
pipelinesascode.tekton.dev/on-cel-expression: event == "push" && target_branch == "main" && files.all.exists(x, !x.matches('^olm-catalog/') && !x.matches('^.konflux-release/'))
build.appstudio.openshift.io/build-nudge-files: ".*Dockerfile.*,olm-catalog/.*.yaml,olm-catalog/.*.yml,.*Containerfile.*"
creationTimestamp: null
labels:
appstudio.openshift.io/application: serverless-operator-136
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@ generated-files-release-next: release-files
(cd olm-catalog/serverless-operator && USE_RELEASE_NEXT=true ./hack/update-manifests.sh)
./hack/update-deps.sh

verify-csv-revisions: install-tools
./hack/verify-csv-revisions.sh

# Runs the lints Github Actions do too.
lint:
woke
Expand Down
88 changes: 61 additions & 27 deletions hack/lib/images.bash
Original file line number Diff line number Diff line change
Expand Up @@ -332,33 +332,8 @@ function latest_registry_redhat_io_image_sha() {
return
fi

if [[ "$image" == *@* ]]; then
suffix="@${image##*@}" # Extract the sha
else
if [ "${return_input_on_empty}" = "true" ]; then
suffix=":latest" # No @, set suffix to `:latest` tag
else
echo "Digest is empty and for this image ${image} a digest is expected"
exit 1
fi
fi

image_name=${image_without_tag##*/} # Get image name after last slash

# Add rhel suffix
if [ "${image_name}" == "serverless-openshift-kn-operator" ]; then
# serverless-openshift-kn-operator is special, as it has rhel in the middle of the name
# see https://redhat-internal.slack.com/archives/CKR568L8G/p1729684088850349
image_name="serverless-openshift-kn-rhel$(get_serverless_operator_rhel_version)-operator"
elif [ "${image_name}" == "serverless-bundle" ]; then
# serverless-bundle is special, as it has no rhelXYZ in the name
image_name="serverless-bundle"
else
# for other images simply add it as a suffix
image_name="${image_name}-rhel$(get_serverless_operator_rhel_version)"
fi

echo "${registry_redhat_io}/${image_name}${suffix}"
rh_registry_image="$(get_rh_registry_image_ref "$image")"
echo "$rh_registry_image"
}

function latest_konflux_image_sha() {
Expand Down Expand Up @@ -407,3 +382,62 @@ function get_app_version_from_tag() {
app_version=${app_version/./} # -> 134
echo "${app_version}"
}

# returns the quay image for a given rh registry image ref
function get_quay_image_ref() {
local rh_registry_image_ref
rh_registry_image_ref="${1}"

if [[ $rh_registry_image_ref =~ $registry_redhat_io ]]; then
image=${rh_registry_image_ref##*/} # Get image name after last slash
image_sha=${image##*@} # Get SHA of image
image_name=${image%@*} # Remove sha

if [[ "${image_name}" =~ ^serverless-openshift-kn-rhel[0-9]+-operator$ ]]; then
# serverless-openshift-kn-operator is special, as it has rhel in the middle of the name
# see https://redhat-internal.slack.com/archives/CKR568L8G/p1729684088850349
component="serverless-openshift-kn-operator"
elif [[ "${image_name}" == "serverless-operator-bundle" ]]; then
# serverless-operator-bundle is special, as it is named only serverless-bundle in quay
component="serverless-bundle"
else
# for other images simply remove the -rhelXYZ suffix
component=${image_name%-rhel*}
fi

echo "${registry_quay}/${component}@${image_sha}"
else
echo "Image must be from ${registry_redhat_io}, got ${rh_registry_image_ref}"
return 1
fi
}

# returns the RH registry image for a given quay image ref
function get_rh_registry_image_ref() {
local quay_registry_image_ref
quay_registry_image_ref="${1}"

if [[ $quay_registry_image_ref =~ $registry_quay ]]; then
image=${quay_registry_image_ref##*/} # Get image name after last slash
image_sha=${image##*@} # Get SHA of image
image_name=${image%@*} # Remove sha

# Add rhel suffix
if [ "${image_name}" == "serverless-openshift-kn-operator" ]; then
# serverless-openshift-kn-operator is special, as it has rhel in the middle of the name
# see https://redhat-internal.slack.com/archives/CKR568L8G/p1729684088850349
image_name="serverless-openshift-kn-rhel$(get_serverless_operator_rhel_version)-operator"
elif [ "${image_name}" == "serverless-bundle" ]; then
# serverless-bundle is special, as it has no rhelXYZ in the name
image_name="serverless-bundle"
else
# for other images simply add it as a suffix
image_name="${image_name}-rhel$(get_serverless_operator_rhel_version)"
fi

echo "${registry_redhat_io}/${image_name}@${image_sha}"
else
echo "Image must be from ${registry_quay}, got ${quay_registry_image_ref}"
return 1
fi
}
45 changes: 45 additions & 0 deletions hack/verify-csv-revisions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env bash

source "$(dirname "${BASH_SOURCE[0]}")/lib/__sources__.bash"

# verify that the revisions (git commit) for components from the same repo match
function verify_image_revisions {
local root_dir csv_file repo_revision rc
root_dir="$(dirname "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")"
csv_file="${root_dir}/olm-catalog/serverless-operator/manifests/serverless-operator.clusterserviceversion.yaml"
declare -A repo_revision=()
rc=0

while IFS= read -r image_ref; do

if [[ $image_ref =~ $registry_redhat_io ]]; then
quay_image_ref="$(get_quay_image_ref "$image_ref")"
parameters="$(cosign download attestation "${quay_image_ref}" | jq -r '.payload' | base64 -d | jq -c '.predicate.invocation.parameters')"
repo="$(echo "${parameters}" | jq -r '."git-url"')"
revision="$(echo "${parameters}" | jq -r ".revision")"
repo=${repo%".git"} # remove optional .git suffix from repo name

if [[ ! -v repo_revision[$repo] ]]; then
# no revision for repo so far --> add it to map
repo_revision[$repo]=$revision
else
if [[ "${repo_revision[$repo]}" != "$revision" ]]; then
# revisions don't match
image=${image_ref##*/} # Get image name after last slash

echo "Revision for ${image} didn't match. Expected revision ${repo_revision[$repo]} for repo ${repo}, but got ${revision}"
rc=1
fi
fi
fi

done <<< "$(yq read "${csv_file}" 'spec.relatedImages[*].image' | sort | uniq)"

if [[ "$rc" == "0" ]]; then
echo "All revisions matched correctly"
fi

return $rc
}

verify_image_revisions

0 comments on commit 3c94bda

Please sign in to comment.