Skip to content

K8SPG-995: Add a check between cr and release_versions images for release#1614

Open
eleo007 wants to merge 4 commits into
mainfrom
rel_ver_cr_check
Open

K8SPG-995: Add a check between cr and release_versions images for release#1614
eleo007 wants to merge 4 commits into
mainfrom
rel_ver_cr_check

Conversation

@eleo007

@eleo007 eleo007 commented May 25, 2026

Copy link
Copy Markdown
Contributor

CHANGE DESCRIPTION

Problem:
During the release there are cases when only the release_versions file is updated when the images are changed but images in default cr stay old ones. This PR introduces a check for release branch that the images in release_versions and in default cr are the same.

Checked PR with release branch: https://github.com/percona/percona-postgresql-operator/actions/runs/26392941587/job/77686723126?pr=1613

Cause:
Short explanation of the root cause of the issue if applicable.

Solution:
Short explanation of the solution we are providing with this PR.

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PG version?
  • Does the change support oldest and newest supported Kubernetes version?

Copilot AI review requested due to automatic review settings May 25, 2026 09:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a release-branch-only GitHub Actions check to ensure the default CR (deploy/cr.yaml) uses the same container images (and operator version) as defined in e2e-tests/release_versions, preventing releases where only release_versions was updated.

Changes:

  • Introduces a new workflow job that parses deploy/cr.yaml and compares key images against e2e-tests/release_versions for release PRs.
  • Fails the workflow with actionable ::error:: messages when mismatches are detected.

Comment on lines +137 to +141
expected_pgbouncer="${registry}/${!pgbouncer_var}"
expected_backrest="${registry}/${!backrest_var}"
expected_pmm="${registry}/${IMAGE_PMM3_CLIENT}"
expected_cr_version="${IMAGE_OPERATOR##*:}"

@eleo007 eleo007 marked this pull request as ready for review May 25, 2026 09:29
egegunes
egegunes previously approved these changes May 26, 2026
Comment thread .github/workflows/reviewdog.yml Outdated
Comment on lines +142 to +146
spec_image=$(grep -E '^ image: ' deploy/cr.yaml | head -1 | awk '{print $2}')
pgbouncer_image=$(sed -n '/^ pgBouncer:/,/^ image:/p' deploy/cr.yaml | grep -E '^ image: ' | head -1 | awk '{print $2}')
backrest_image=$(sed -n '/^ pgbackrest:/,/^ image:/p' deploy/cr.yaml | grep -E '^ image: ' | head -1 | awk '{print $2}')
pmm_image=$(sed -n '/^ pmm:/,/^ image:/p' deploy/cr.yaml | grep -E '^ image: ' | head -1 | awk '{print $2}')
cr_version=$(grep -E '^[[:space:]]*crVersion:' deploy/cr.yaml | head -1 | awk '{print $2}')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wonder if using yq would be simpler?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@valmiranogueira valmiranogueira self-requested a review May 27, 2026 11:56

@hors hors left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eleo007 please add task number

@eleo007 eleo007 dismissed stale reviews from valmiranogueira and egegunes via 2e2841a June 8, 2026 15:29
@eleo007 eleo007 changed the title Add a check between cr and release_versions images for release K8SPG-995: Add a check between cr and release_versions images for release Jun 8, 2026
Copilot AI review requested due to automatic review settings June 8, 2026 15:35
@eleo007 eleo007 requested a review from hors June 8, 2026 15:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/reviewdog.yml Outdated
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: mikefarah/yq@v4
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 8, 2026 17:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment on lines +127 to +135
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 +112 to +114
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- uses: mikefarah/yq@v4
- name: Verify deploy/cr.yaml images match release_versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants