Skip to content

Commit f716e2f

Browse files
fix(postgres-operator): align CNPG CRDs with 1.27.3
The operator image is pinned to 1.27.3 while the vendored chart and CRDs still advertise 1.27.1. Kubernetes prunes Backup status.instanceID.sessionID, causing false instance-manager restart failures. Import the official 1.27.3 CRDs, align the chart appVersion, and preserve the overlay across make update. Add render and API round-trip regression coverage. Assisted-By: GPT-5 <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent ef72c63 commit f716e2f

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)