Skip to content

Comments

K8SPG-647: Fix major-upgrade test#988

Closed
egegunes wants to merge 368 commits intomainfrom
K8SPG-647
Closed

K8SPG-647: Fix major-upgrade test#988
egegunes wants to merge 368 commits intomainfrom
K8SPG-647

Conversation

@egegunes
Copy link
Contributor

@egegunes egegunes commented Dec 18, 2024

K8SPG-647 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:
Short explanation of the problem.

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?

@egegunes egegunes force-pushed the K8SPG-647 branch 2 times, most recently from 6d4a751 to 0ae6b24 Compare April 11, 2025 15:17
hors and others added 27 commits July 21, 2025 21:01
K8SPG-624 Add support for S3ForcePathStyle and verifyTLS for custom extensions
…iner image instead of using the operator image (#1236)
* Add collation mismatch check

* Add end of file lines

* Skip verification by default and improve failure message

---------

Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
* K8SPG-748 update statuses

* update status for patroni and pgbackrest

* update test

* update tests

* delete unused

* update status naming

* fix image

---------

Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
* K8SPG-724: fix extension reinstall

https://perconadev.atlassian.net/browse/K8SPG-724

* revert test changes

* fix merge

---------

Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
* K8SPG-718 patroni metrics to pmm

* remove hardcoded versions, the tests will fail but they will pass again once we bump the version officially to 2.8

---------

Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
* K8SPG-781 add original error

* K8SPG-781 add original error

* K8SPG-781 add original error

* fix PR comments

---------

Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
* K8SPG-768 skip annotation updates

* K8SPG-768 skip annotation updates

* fix test

* add test

* fix test

* fix version

* fix version

---------

Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
)

* K8SPG-832: add `.spec.backups.pgbackrest.repoHost.sidecars` field

https://perconadev.atlassian.net/browse/K8SPG-832

* address comments

---------

Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
Bumps [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) from 0.31.0 to 0.32.0.
- [Release notes](https://github.com/aquasecurity/trivy-action/releases)
- [Commits](aquasecurity/trivy-action@0.31.0...0.32.0)

---
updated-dependencies:
- dependency-name: aquasecurity/trivy-action
  dependency-version: 0.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* K8SPG-833: add `env` and `envFrom` fields

https://perconadev.atlassian.net/browse/K8SPG-833

* fix misprint

* address comment

* add envFrom hashes

* fix lint

* revert formatting

---------

Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.33.2 to 0.33.3.
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](kubernetes/client-go@v0.33.2...v0.33.3)

---
updated-dependencies:
- dependency-name: k8s.io/client-go
  dependency-version: 0.33.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
* CLOUD-727: Bump sigs.k8s.io/yaml from 1.5.0 to 1.6.0

Bumps [sigs.k8s.io/yaml](https://github.com/kubernetes-sigs/yaml) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/kubernetes-sigs/yaml/releases)
- [Changelog](https://github.com/kubernetes-sigs/yaml/blob/master/RELEASE.md)
- [Commits](kubernetes-sigs/yaml@v1.5.0...v1.6.0)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/yaml
  dependency-version: 1.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* use hetzner worker

* add make

* add docker-init

* remove docker-ce

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
Bumps [k8s.io/component-base](https://github.com/kubernetes/component-base) from 0.33.2 to 0.33.3.
- [Commits](kubernetes/component-base@v0.33.2...v0.33.3)

---
updated-dependencies:
- dependency-name: k8s.io/component-base
  dependency-version: 0.33.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/golang-jwt/jwt/v5](https://github.com/golang-jwt/jwt) from 5.2.2 to 5.3.0.
- [Release notes](https://github.com/golang-jwt/jwt/releases)
- [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md)
- [Commits](golang-jwt/jwt@v5.2.2...v5.3.0)

---
updated-dependencies:
- dependency-name: github.com/golang-jwt/jwt/v5
  dependency-version: 5.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.73.0 to 1.74.2.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.73.0...v1.74.2)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-version: 1.74.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.37.0 to 1.38.0.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](onsi/gomega@v1.37.0...v1.38.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-version: 1.38.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…1241)

Bumps [k8s.io/apiextensions-apiserver](https://github.com/kubernetes/apiextensions-apiserver) from 0.33.2 to 0.33.3.
- [Release notes](https://github.com/kubernetes/apiextensions-apiserver/releases)
- [Commits](kubernetes/apiextensions-apiserver@v0.33.2...v0.33.3)

---
updated-dependencies:
- dependency-name: k8s.io/apiextensions-apiserver
  dependency-version: 0.33.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.55.7 to 1.55.8.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG_PENDING.md)
- [Commits](aws/aws-sdk-go@v1.55.7...v1.55.8)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-version: 1.55.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.35.0 to 0.36.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](golang/tools@v0.35.0...v0.36.0)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-version: 0.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…1252)

Bumps [github.com/go-openapi/errors](https://github.com/go-openapi/errors) from 0.22.1 to 0.22.2.
- [Commits](go-openapi/errors@v0.22.1...v0.22.2)

---
updated-dependencies:
- dependency-name: github.com/go-openapi/errors
  dependency-version: 0.22.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…1253)

Bumps [k8s.io/apiextensions-apiserver](https://github.com/kubernetes/apiextensions-apiserver) from 0.33.3 to 0.33.4.
- [Release notes](https://github.com/kubernetes/apiextensions-apiserver/releases)
- [Commits](kubernetes/apiextensions-apiserver@v0.33.3...v0.33.4)

---
updated-dependencies:
- dependency-name: k8s.io/apiextensions-apiserver
  dependency-version: 0.33.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.23.4 to 2.24.0.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](onsi/ginkgo@v2.23.4...v2.24.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-version: 2.24.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
nmarukovich and others added 22 commits February 10, 2026 16:50
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
K8SPG-740 fix error message
Signed-off-by: Mayank Shah <mayank.shah@percona.com>
* K8SPG-694: add `clusterServiceDNSSuffix`

https://perconadev.atlassian.net/browse/K8SPG-694

* revert change of `exposeSuperusers`

* revert default annotations

* fix `cr.yaml`

* improve unit-tests

---------

Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
Co-authored-by: Mayank Shah <mayankshah1614@gmail.com>
* wip: add fencing mechanism

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* rename to suspended-instances

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* add BackupSnapshots feature gate

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* implement reconciler logic

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* implement offline executor

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* naming improvements

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* add to scheme

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* fix reconcile state

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* bug fixes and improvements

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* naming improvements and fixes

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* ran make generate

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* fix PGBackup field validations

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* refactors and stability improvements

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* update cr.yaml examples

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* organize imports

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* misspells

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* improve fencing logic

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* add extra validation

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* improvements to suspended logic

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* finalizer renaming

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* remove enabled field

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* implement snapshot schedules

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* linting

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* implement in-place restore

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* update cr.yaml example

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* linting

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* no need to use configmap to track

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* more improvements

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* typo

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* wip: PiTR

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* support snapshots in WALWatcher

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* bug fix

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* update comments

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* linting

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* add PGO_FEATURE_GATES env variable to deploy

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* add retry mechanism

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* implement checkpointing

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* add restore_command wrapper for snapshots

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* add logic for creating snapshot signal file

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* handle leader ep reconcile

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* more improvements

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* add e2e test

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* wip: fix pitr

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* in-place restore improvements

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* update e2e test

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* update test runs

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* test fixes

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* Update build/postgres-operator/restore_command.sh

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* support for WAL and Tablespace volumes

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* fix tests

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* workaround improvements

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* update examples

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* fix unit test

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* remove unused code

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* add unit test shouldFailSnapshot

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* add unit tests for backup helpers

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* linting

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* cleanup unused code

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* formatting

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* code cleanup

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* status improvements

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* add more unit tests

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* update e2e test assertions

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* fix inconsistencies & address copilot comments

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* remove sh prefix

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* checkpoint timeout default to 5m

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* linting

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* POSIX-compliant script

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* fix potential nil-ptr

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* fix error messag

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* fix invalid status update

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* fix retries to get latest objecgt

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* bugfix: restore reconcile can use incorrect volume spec

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* add unit test

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* fix linting suggestions

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* prepare job should work when using separate wal volumes

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* update unit tests

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* spelling errors

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* allow configuring checkpoint timeout

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* fix restore wrapper

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* consistent field naming

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* fix retry loop

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* no need to check PITR while unsuspending

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* error message consistency

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* remove duplicate code

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* use fmt.Errorf

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* catch potential nil error

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* allow skipping checkpointing

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* address copilot comments

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

* fix error message

Signed-off-by: Mayank Shah <mayank.shah@percona.com>

---------

Signed-off-by: Mayank Shah <mayank.shah@percona.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* bump golang to 1.26.0


Signed-off-by: Mayank Shah <mayank.shah@percona.com>
* K8SPG-938 fix conditions

* add test

* add unit test

* delete comment
Copilot AI review requested due to automatic review settings February 17, 2026 14:23
Copy link

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

shfmt

[shfmt] reported by reviewdog 🐶

if [[ "${huge_pages}" == *"${expected_value}"* ]]; then
echo "PostgreSQL huge_pages is set to '${expected_value}'"
return 0
else
echo "PostgreSQL huge_pages not set to '${expected_value}' (value: ${huge_pages})"
return 1
fi


[shfmt] reported by reviewdog 🐶

local pod_name=$1
local namespace=$2
local container=${3:-database}


[shfmt] reported by reviewdog 🐶

echo "Checking hugepages usage..."


[shfmt] reported by reviewdog 🐶

kubectl -n ${namespace} exec ${pod_name} -c ${container} -- \
grep HugePages /proc/meminfo


[shfmt] reported by reviewdog 🐶

local hugepages_total=$(kubectl -n ${namespace} exec ${pod_name} -c ${container} -- \
grep HugePages_Total /proc/meminfo | awk '{print $2}')


[shfmt] reported by reviewdog 🐶

local hugepages_free=$(kubectl -n ${namespace} exec ${pod_name} -c ${container} -- \
grep HugePages_Free /proc/meminfo | awk '{print $2}')


[shfmt] reported by reviewdog 🐶

local hugepages_used=$((hugepages_total - hugepages_free))


[shfmt] reported by reviewdog 🐶

echo ""
echo "HugePages usage:"
echo " Total: ${hugepages_total}"
echo " Used: ${hugepages_used}"


[shfmt] reported by reviewdog 🐶

if [ "${hugepages_used}" -gt 0 ]; then
echo "PostgreSQL is using hugepages"
return 0
else
echo "Hugepages available but NOT being used by PostgreSQL"
return 1
fi
}

kubectl -n "${NAMESPACE}" create secret generic "${test_name}-pgbackrest-secrets" --from-file=cloud.conf="${TEMP_DIR}/pgbackrest-secret.ini" --from-file=gcs-key.json=${TEMP_DIR}/gcs-key.json
;;
"custom-extensions" | "major-upgrade")
"custom-extensions"| "builtin-extensions"| major-upgrade*)
Copy link
Contributor

Choose a reason for hiding this comment

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

[shfmt] reported by reviewdog 🐶

Suggested change
"custom-extensions"| "builtin-extensions"| major-upgrade*)
"custom-extensions" | "builtin-extensions" | major-upgrade*)

Comment on lines +1184 to +1186
local namespace=$1
local pod=$2
local container=$3
Copy link
Contributor

Choose a reason for hiding this comment

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

[shfmt] reported by reviewdog 🐶

Suggested change
local namespace=$1
local pod=$2
local container=$3
local namespace=$1
local pod=$2
local container=$3

Comment on lines +1188 to +1192
if [ -n "$container" ]; then
kubectl exec -n "$namespace" "$pod" -c "$container" -- printenv 2>/dev/null || true
else
kubectl exec -n "$namespace" "$pod" -- printenv 2>/dev/null || true
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

[shfmt] reported by reviewdog 🐶

Suggested change
if [ -n "$container" ]; then
kubectl exec -n "$namespace" "$pod" -c "$container" -- printenv 2>/dev/null || true
else
kubectl exec -n "$namespace" "$pod" -- printenv 2>/dev/null || true
fi
if [ -n "$container" ]; then
kubectl exec -n "$namespace" "$pod" -c "$container" -- printenv 2>/dev/null || true
else
kubectl exec -n "$namespace" "$pod" -- printenv 2>/dev/null || true
fi

Comment on lines +1197 to +1223
local check_type=$1
local pod=$2
local var_name=$3
local expected_value=$4
local env_content=$5

local actual_value
actual_value=$(echo "$env_content" | grep -E "^${var_name}=" | cut -d'=' -f2- || true)

if [[ "$check_type" == "add" ]]; then
if [ "$actual_value" != "$expected_value" ]; then
echo "ERROR: $var_name in $pod — expected '$expected_value', got '${actual_value:-<missing>}'"
return 1
else
echo "OK: $var_name=$actual_value in $pod"
fi
elif [[ "$check_type" == "delete" ]]; then
if [ -n "$actual_value" ]; then
echo "ERROR: $var_name exists in $pod (should not exist)"
return 1
else
echo "OK: $var_name deleted in $pod"
fi
else
echo "ERROR: unknown check type '$check_type'"
return 1
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

[shfmt] reported by reviewdog 🐶

Suggested change
local check_type=$1
local pod=$2
local var_name=$3
local expected_value=$4
local env_content=$5
local actual_value
actual_value=$(echo "$env_content" | grep -E "^${var_name}=" | cut -d'=' -f2- || true)
if [[ "$check_type" == "add" ]]; then
if [ "$actual_value" != "$expected_value" ]; then
echo "ERROR: $var_name in $pod — expected '$expected_value', got '${actual_value:-<missing>}'"
return 1
else
echo "OK: $var_name=$actual_value in $pod"
fi
elif [[ "$check_type" == "delete" ]]; then
if [ -n "$actual_value" ]; then
echo "ERROR: $var_name exists in $pod (should not exist)"
return 1
else
echo "OK: $var_name deleted in $pod"
fi
else
echo "ERROR: unknown check type '$check_type'"
return 1
fi
local check_type=$1
local pod=$2
local var_name=$3
local expected_value=$4
local env_content=$5
local actual_value
actual_value=$(echo "$env_content" | grep -E "^${var_name}=" | cut -d'=' -f2- || true)
if [[ $check_type == "add" ]]; then
if [ "$actual_value" != "$expected_value" ]; then
echo "ERROR: $var_name in $pod — expected '$expected_value', got '${actual_value:-<missing>}'"
return 1
else
echo "OK: $var_name=$actual_value in $pod"
fi
elif [[ $check_type == "delete" ]]; then
if [ -n "$actual_value" ]; then
echo "ERROR: $var_name exists in $pod (should not exist)"
return 1
else
echo "OK: $var_name deleted in $pod"
fi
else
echo "ERROR: unknown check type '$check_type'"
return 1
fi

Comment on lines +1228 to +1271
local check_type=$1 # add | delete
local component=$2 # instance | pgbouncer | repohost
local vars=("${@:3}") # everything after the 2nd argument

case "$component" in
instance)
POD=$(kubectl get -n "${NAMESPACE}" pod -l postgres-operator.crunchydata.com/instance-set=instance1 -o 'jsonpath={.items[0].metadata.name}')
CONTAINER=""
;;
pgbouncer)
POD=$(kubectl get -n "${NAMESPACE}" pod -l postgres-operator.crunchydata.com/role=pgbouncer -o 'jsonpath={.items[0].metadata.name}')
CONTAINER="pgbouncer"
;;
repohost)
POD=$(kubectl get -n "${NAMESPACE}" pod -l postgres-operator.crunchydata.com/data=pgbackrest -o 'jsonpath={.items[0].metadata.name}')
CONTAINER="pgbackrest"
;;
*)
echo "ERROR: unknown component '$component'"
return 1
;;
esac

echo "Fetching environment variables for $component pod $POD..."
local env_content
env_content=$(get_envs_from_pod "${NAMESPACE}" "$POD" "$CONTAINER")

local errors=0
for var_entry in "${vars[@]}"; do
if [[ "$check_type" == "add" ]]; then
local var_name="${var_entry%%=*}"
local var_expected="${var_entry#*=}"
check_env_in_pod add "$POD" "$var_name" "$var_expected" "$env_content" || errors=$((errors+1))
else
check_env_in_pod delete "$POD" "$var_entry" "" "$env_content" || errors=$((errors+1))
fi
done

if (( errors > 0 )); then
echo "$errors environment check(s) failed for component '$component'"
return 1
else
echo "All environment checks passed for component '$component'"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

[shfmt] reported by reviewdog 🐶

Suggested change
local check_type=$1 # add | delete
local component=$2 # instance | pgbouncer | repohost
local vars=("${@:3}") # everything after the 2nd argument
case "$component" in
instance)
POD=$(kubectl get -n "${NAMESPACE}" pod -l postgres-operator.crunchydata.com/instance-set=instance1 -o 'jsonpath={.items[0].metadata.name}')
CONTAINER=""
;;
pgbouncer)
POD=$(kubectl get -n "${NAMESPACE}" pod -l postgres-operator.crunchydata.com/role=pgbouncer -o 'jsonpath={.items[0].metadata.name}')
CONTAINER="pgbouncer"
;;
repohost)
POD=$(kubectl get -n "${NAMESPACE}" pod -l postgres-operator.crunchydata.com/data=pgbackrest -o 'jsonpath={.items[0].metadata.name}')
CONTAINER="pgbackrest"
;;
*)
echo "ERROR: unknown component '$component'"
return 1
;;
esac
echo "Fetching environment variables for $component pod $POD..."
local env_content
env_content=$(get_envs_from_pod "${NAMESPACE}" "$POD" "$CONTAINER")
local errors=0
for var_entry in "${vars[@]}"; do
if [[ "$check_type" == "add" ]]; then
local var_name="${var_entry%%=*}"
local var_expected="${var_entry#*=}"
check_env_in_pod add "$POD" "$var_name" "$var_expected" "$env_content" || errors=$((errors+1))
else
check_env_in_pod delete "$POD" "$var_entry" "" "$env_content" || errors=$((errors+1))
fi
done
if (( errors > 0 )); then
echo "$errors environment check(s) failed for component '$component'"
return 1
else
echo "All environment checks passed for component '$component'"
fi
local check_type=$1 # add | delete
local component=$2 # instance | pgbouncer | repohost
local vars=("${@:3}") # everything after the 2nd argument
case "$component" in
instance)
POD=$(kubectl get -n "${NAMESPACE}" pod -l postgres-operator.crunchydata.com/instance-set=instance1 -o 'jsonpath={.items[0].metadata.name}')
CONTAINER=""
;;
pgbouncer)
POD=$(kubectl get -n "${NAMESPACE}" pod -l postgres-operator.crunchydata.com/role=pgbouncer -o 'jsonpath={.items[0].metadata.name}')
CONTAINER="pgbouncer"
;;
repohost)
POD=$(kubectl get -n "${NAMESPACE}" pod -l postgres-operator.crunchydata.com/data=pgbackrest -o 'jsonpath={.items[0].metadata.name}')
CONTAINER="pgbackrest"
;;
*)
echo "ERROR: unknown component '$component'"
return 1
;;
esac
echo "Fetching environment variables for $component pod $POD..."
local env_content
env_content=$(get_envs_from_pod "${NAMESPACE}" "$POD" "$CONTAINER")
local errors=0
for var_entry in "${vars[@]}"; do
if [[ $check_type == "add" ]]; then
local var_name="${var_entry%%=*}"
local var_expected="${var_entry#*=}"
check_env_in_pod add "$POD" "$var_name" "$var_expected" "$env_content" || errors=$((errors + 1))
else
check_env_in_pod delete "$POD" "$var_entry" "" "$env_content" || errors=$((errors + 1))
fi
done
if ((errors > 0)); then
echo "$errors environment check(s) failed for component '$component'"
return 1
else
echo "All environment checks passed for component '$component'"
fi

Comment on lines +1567 to +1573
if [ "${hugepages_total}" -gt 0 ]; then
echo "Hugepages are available in pod"
return 0
else
echo "No hugepages in pod"
return 1
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

[shfmt] reported by reviewdog 🐶

Suggested change
if [ "${hugepages_total}" -gt 0 ]; then
echo "Hugepages are available in pod"
return 0
else
echo "No hugepages in pod"
return 1
fi
if [ "${hugepages_total}" -gt 0 ]; then
echo "Hugepages are available in pod"
return 0
else
echo "No hugepages in pod"
return 1
fi

Comment on lines +1577 to +1578
local cluster_name=$1
local expected_value=${2:-try}
Copy link
Contributor

Choose a reason for hiding this comment

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

[shfmt] reported by reviewdog 🐶

Suggested change
local cluster_name=$1
local expected_value=${2:-try}
local cluster_name=$1
local expected_value=${2:-try}

local cluster_name=$1
local expected_value=${2:-try}

echo "Verifying PostgreSQL huge_pages setting..."
Copy link
Contributor

Choose a reason for hiding this comment

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

[shfmt] reported by reviewdog 🐶

Suggested change
echo "Verifying PostgreSQL huge_pages setting..."
echo "Verifying PostgreSQL huge_pages setting..."

Comment on lines +1582 to +1584
local huge_pages=$(run_psql_local \
"SHOW huge_pages;" \
"postgres:$(get_psql_user_pass ${cluster_name}-pguser-postgres)@$(get_psql_user_host ${cluster_name}-pguser-postgres)")
Copy link
Contributor

Choose a reason for hiding this comment

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

[shfmt] reported by reviewdog 🐶

Suggested change
local huge_pages=$(run_psql_local \
"SHOW huge_pages;" \
"postgres:$(get_psql_user_pass ${cluster_name}-pguser-postgres)@$(get_psql_user_host ${cluster_name}-pguser-postgres)")
local huge_pages=$(run_psql_local \
"SHOW huge_pages;" \
"postgres:$(get_psql_user_pass ${cluster_name}-pguser-postgres)@$(get_psql_user_host ${cluster_name}-pguser-postgres)")

"SHOW huge_pages;" \
"postgres:$(get_psql_user_pass ${cluster_name}-pguser-postgres)@$(get_psql_user_host ${cluster_name}-pguser-postgres)")

echo "huge_pages: ${huge_pages}"
Copy link
Contributor

Choose a reason for hiding this comment

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

[shfmt] reported by reviewdog 🐶

Suggested change
echo "huge_pages: ${huge_pages}"
echo "huge_pages: ${huge_pages}"

"github.com/percona/percona-postgresql-operator/internal/bridge"
"github.com/percona/percona-postgresql-operator/internal/initialize"
"github.com/percona/percona-postgresql-operator/v2/internal/bridge"
"github.com/percona/percona-postgresql-operator/v2/internal/initialize"

Copy link
Contributor

Choose a reason for hiding this comment

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

[goimports-reviser] reported by reviewdog 🐶

Suggested change

@@ -15,9 +15,9 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Copy link
Contributor

Choose a reason for hiding this comment

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

[goimports-reviser] reported by reviewdog 🐶

Suggested change
"sigs.k8s.io/controller-runtime/pkg/client"

@@ -13,7 +13,7 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gstruct"
"github.com/pkg/errors"
"github.com/pkg/errors" //nolint:depguard // This legacy test covers so much code, it logs the origin of unexpected errors.

Copy link
Contributor

Choose a reason for hiding this comment

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

[goimports-reviser] reported by reviewdog 🐶

Suggested change

Comment on lines 19 to 20
volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"

Copy link
Contributor

Choose a reason for hiding this comment

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

[goimports-reviser] reported by reviewdog 🐶

Suggested change
volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"

@@ -16,9 +16,9 @@ import (

"github.com/pkg/errors"

Copy link
Contributor

Choose a reason for hiding this comment

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

[goimports-reviser] reported by reviewdog 🐶

Suggested change
corev1 "k8s.io/api/core/v1"

"strings"
"testing"

"github.com/stretchr/testify/assert"
Copy link
Contributor

Choose a reason for hiding this comment

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

[goimports-reviser] reported by reviewdog 🐶

Suggested change
"github.com/stretchr/testify/assert"
volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
"github.com/stretchr/testify/assert"

"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/fake"

volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"
Copy link
Contributor

Choose a reason for hiding this comment

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

[goimports-reviser] reported by reviewdog 🐶

Suggested change
volumesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1"

@@ -6,10 +6,12 @@ import (
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Copy link
Contributor

Choose a reason for hiding this comment

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

[goimports-reviser] reported by reviewdog 🐶

Suggested change

"testing"
"time"

"github.com/percona/percona-postgresql-operator/v2/percona/version"
Copy link
Contributor

Choose a reason for hiding this comment

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

[goimports-reviser] reported by reviewdog 🐶

Suggested change
"github.com/percona/percona-postgresql-operator/v2/percona/version"

"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/percona/percona-postgresql-operator/v2/percona/testutils"
pgv2 "github.com/percona/percona-postgresql-operator/v2/pkg/apis/pgv2.percona.com/v2"
Copy link
Contributor

Choose a reason for hiding this comment

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

[goimports-reviser] reported by reviewdog 🐶

Suggested change
pgv2 "github.com/percona/percona-postgresql-operator/v2/pkg/apis/pgv2.percona.com/v2"
"github.com/percona/percona-postgresql-operator/v2/percona/version"
pgv2 "github.com/percona/percona-postgresql-operator/v2/pkg/apis/pgv2.percona.com/v2"

Copy link
Contributor

Choose a reason for hiding this comment

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

[goimports-reviser] reported by reviewdog 🐶

Copy link
Contributor

Choose a reason for hiding this comment

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

[goimports-reviser] reported by reviewdog 🐶

apierrors "k8s.io/apimachinery/pkg/api/errors"
"github.com/pkg/errors"

@JNKPercona
Copy link
Collaborator

Test Name Result Time
backup-enable-disable passed 00:07:11
builtin-extensions passed 00:05:03
custom-envs passed 00:18:56
custom-extensions passed 00:14:01
custom-tls passed 00:04:53
database-init-sql passed 00:02:20
demand-backup passed 00:26:05
demand-backup-offline-snapshot failure 00:29:25
finalizers passed 00:03:37
init-deploy passed 00:02:37
huge-pages passed 00:02:57
monitoring passed 00:06:41
monitoring-pmm3 passed 00:09:04
one-pod passed 00:05:36
operator-self-healing passed 00:08:57
pitr failure 00:22:38
scaling passed 00:05:45
scheduled-backup failure 00:37:45
self-healing passed 00:11:19
sidecars passed 00:03:12
standby-pgbackrest passed 00:11:45
standby-streaming passed 00:09:51
start-from-backup passed 00:13:04
tablespaces passed 00:06:33
telemetry-transfer passed 00:03:34
upgrade-consistency passed 00:05:37
upgrade-minor passed 00:07:14
users passed 00:05:09
Summary Value
Tests Run 28/28
Job Duration 01:48:59
Total Test Time 04:51:04

commit: dc1d761
image: perconalab/percona-postgresql-operator:PR-988-dc1d76162

@egegunes egegunes closed this Feb 18, 2026
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.