Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,73 @@ jobs:
make generate VERSION=main
git diff --exit-code

deploy-cr-release-versions:
name: deploy/cr.yaml vs e2e-tests/release_versions
if: ${{ contains(github.base_ref, 'release-') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Comment thread
eleo007 marked this conversation as resolved.
Outdated
- uses: mikefarah/yq@v4
- name: Verify deploy/cr.yaml images match release_versions
Comment on lines +112 to +114
run: |
set -euo pipefail
# shellcheck disable=SC1091
source e2e-tests/release_versions

registry="${REGISTRY_NAME:-docker.io}"
pg_ver=$(yq -r '.spec.postgresVersion' deploy/cr.yaml)
if [ -z "$pg_ver" ] || [ "$pg_ver" = "null" ]; then
echo "::error::spec.postgresVersion not found in deploy/cr.yaml"
exit 1
fi

postgres_var="IMAGE_POSTGRESQL${pg_ver}"
pgbouncer_var="IMAGE_PGBOUNCER${pg_ver}"
backrest_var="IMAGE_BACKREST${pg_ver}"
for var in "$postgres_var" "$pgbouncer_var" "$backrest_var"; do
if [ -z "${!var:-}" ]; then
echo "::error::${var} is not defined in e2e-tests/release_versions"
exit 1
fi
done
Comment on lines +127 to +135

expected_postgres="${registry}/${!postgres_var}"
expected_pgbouncer="${registry}/${!pgbouncer_var}"
expected_backrest="${registry}/${!backrest_var}"
expected_pmm="${registry}/${IMAGE_PMM3_CLIENT}"
expected_cr_version="${IMAGE_OPERATOR##*:}"

Comment on lines +138 to +142
spec_image=$(yq -r '.spec.image' deploy/cr.yaml)
pgbouncer_image=$(yq -r '.spec.proxy.pgBouncer.image' deploy/cr.yaml)
backrest_image=$(yq -r '.spec.backups.pgbackrest.image' deploy/cr.yaml)
pmm_image=$(yq -r '.spec.pmm.image' deploy/cr.yaml)
cr_version=$(yq -r '.spec.crVersion' deploy/cr.yaml)

failed=0
check() {
local name="$1" actual="$2" expected="$3"
if [ -z "$actual" ] || [ "$actual" = "null" ]; then
echo "::error::${name}: missing in deploy/cr.yaml"
failed=1
return
fi
if [ "$actual" != "$expected" ]; then
echo "::error::${name}: deploy/cr.yaml has '${actual}', e2e-tests/release_versions expects '${expected}'"
failed=1
fi
}

check "spec.image (IMAGE_POSTGRESQL${pg_ver})" "$spec_image" "$expected_postgres"
check "spec.proxy.pgBouncer.image (IMAGE_PGBOUNCER${pg_ver})" "$pgbouncer_image" "$expected_pgbouncer"
check "spec.backups.pgbackrest.image (IMAGE_BACKREST${pg_ver})" "$backrest_image" "$expected_backrest"
check "spec.pmm.image (IMAGE_PMM3_CLIENT)" "$pmm_image" "$expected_pmm"
check "spec.crVersion (IMAGE_OPERATOR tag)" "$cr_version" "$expected_cr_version"

if [ "$failed" -ne 0 ]; then
exit 1
fi
echo "deploy/cr.yaml images match e2e-tests/release_versions."

e2e-release-versions-images:
name: e2e-tests release_versions image availability
runs-on: ubuntu-latest
Expand Down
Loading