Skip to content

Add a check between cr and release_versions images for release#1614

Open
eleo007 wants to merge 1 commit into
mainfrom
rel_ver_cr_check
Open

Add a check between cr and release_versions images for release#1614
eleo007 wants to merge 1 commit into
mainfrom
rel_ver_cr_check

Conversation

@eleo007
Copy link
Copy Markdown
Contributor

@eleo007 eleo007 commented May 25, 2026

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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
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?

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.

3 participants