Skip to content

Commit cec6dce

Browse files
fix(postgres-operator): align CNPG CRDs with 1.27.3 (#3528)
## What this PR does Backports #3526 to release-1.4. This aligns the vendored CloudNativePG chart metadata and CRDs with the already-pinned 1.27.3 operator image. CNPG 1.27.3 stores the instance-manager session identifier in `Backup.status.instanceID.sessionID`; the 1.27.1 CRD prunes that field, causing false instance-manager restart errors and failed backups. Addresses #3479. ### Screenshots Not applicable. ### Release note ```release-note fix(postgres-operator): align CloudNativePG CRDs with the pinned 1.27.3 operator image so PostgreSQL backups no longer fail with false instance-manager restart errors ```
2 parents b1f85b6 + 2224d94 commit cec6dce

6 files changed

Lines changed: 550 additions & 25 deletions

File tree

‎hack/e2e-apps/postgres.bats‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,25 @@ EOF
5353
# for some reason it takes longer for the read-only endpoint to be ready
5454
#timeout 120 sh -ec "until kubectl -n tenant-test get endpoints postgres-$name-ro -o jsonpath='{.subsets[*].addresses[*].ip}' | grep -q '[0-9]'; do sleep 10; done"
5555
timeout 120 sh -ec "until kubectl -n tenant-test get endpoints postgres-$name-rw -o jsonpath='{.subsets[*].addresses[*].ip}' | grep -q '[0-9]'; do sleep 10; done"
56+
backup_name="$name-session-id-schema"
57+
kubectl -n tenant-test delete backups.postgresql.cnpg.io "$backup_name" --ignore-not-found --timeout=2m
58+
kubectl -n tenant-test apply -f - <<EOF
59+
apiVersion: postgresql.cnpg.io/v1
60+
kind: Backup
61+
metadata:
62+
name: $backup_name
63+
spec:
64+
cluster:
65+
name: postgres-$name
66+
EOF
67+
kubectl -n tenant-test patch backups.postgresql.cnpg.io "$backup_name" --subresource=status --type=merge -p='{"status":{"phase":"failed","instanceID":{"podName":"schema-probe","sessionID":"cozystack-schema-probe"}}}'
68+
actual_session_id="$(kubectl -n tenant-test get backups.postgresql.cnpg.io "$backup_name" -o jsonpath='{.status.instanceID.sessionID}')"
69+
[ "$actual_session_id" = "cozystack-schema-probe" ] || {
70+
echo "Backup status sessionID was not preserved by the API server"
71+
kubectl -n tenant-test get backups.postgresql.cnpg.io "$backup_name" -o yaml
72+
false
73+
}
74+
kubectl -n tenant-test delete backups.postgresql.cnpg.io "$backup_name" --timeout=2m
5675
kubectl -n tenant-test delete postgreses.apps.cozystack.io $name
5776
kubectl -n tenant-test delete job.batch/postgres-$name-init-job
5877
}

‎packages/system/postgres-operator/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ update:
1212
helm repo update cnpg
1313
helm pull cnpg/cloudnative-pg --untar --untardir charts --version 0.26.1
1414
rm -rf charts/cloudnative-pg/charts
15+
patch --no-backup-if-mismatch -p4 < patches/cloudnative-pg-1.27.3.patch

‎packages/system/postgres-operator/charts/cloudnative-pg/Chart.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v2
2-
appVersion: 1.27.1
2+
appVersion: 1.27.3
33
dependencies:
44
- alias: monitoring
55
condition: monitoring.grafanaDashboard.create

0 commit comments

Comments
 (0)