Skip to content

Commit 0b72af8

Browse files
Replace finalizers instead of removing to avoid conflicts
1 parent 8cb45da commit 0b72af8

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

e2e-tests/functions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function remove_all_finalizers() {
132132
if [[ $(kubectl -n "${NAMESPACE}" get "$resource" "$name" -o yaml | yq '.metadata.finalizers | length') == "0" ]]; then
133133
continue
134134
fi
135-
kubectl -n "${NAMESPACE}" patch "$resource" "$name" --type=json -p='[{"op": "remove", "path": "/metadata/finalizers"}]'
135+
kubectl -n "${NAMESPACE}" patch "$resource" "$name" --type=json -p='[{"op":"replace","path":"/metadata/finalizers","value":[]}]'
136136
kubectl -n "${NAMESPACE}" delete "$resource" "$name" --wait=0
137137
done
138138
done

e2e-tests/tests/migration-from-crunchy-backup-restore/99-cleanup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ commands:
2020
2121
kubectl delete postgrescluster crunchy-source -n "${CRUNCHY_NS}" --ignore-not-found || true
2222
kubectl patch postgrescluster crunchy-source -n "${CRUNCHY_NS}" \
23-
--type=json -p='[{"op":"remove","path":"/metadata/finalizers"}]' 2>/dev/null || true
23+
--type=json -p='[{"op":"replace","path":"/metadata/finalizers","value":[]}]' 2>/dev/null || true
2424
2525
helm uninstall pgo --namespace "${CRUNCHY_NS}" --ignore-not-found || true
2626

e2e-tests/tests/migration-from-crunchy-pv/03-migrate-pv.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ commands:
5050
# 3. Delete the Crunchy cluster and operator — no longer needed once the PV
5151
# is retained. Strip finalizers first so the CR is removed cleanly.
5252
kubectl patch postgrescluster crunchy-source -n "${NAMESPACE}" \
53-
--type=json -p='[{"op":"remove","path":"/metadata/finalizers"}]' 2>/dev/null || true
53+
--type=json -p='[{"op":"replace","path":"/metadata/finalizers","value":[]}]' 2>/dev/null || true
5454
5555
kubectl delete postgrescluster crunchy-source -n "${NAMESPACE}" --ignore-not-found
5656

e2e-tests/tests/migration-from-crunchy-pv/99-cleanup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ commands:
1919
# Remove Crunchy source cluster if it still exists (e.g. test failed
2020
# before step 03 could delete it).
2121
kubectl patch postgrescluster crunchy-source -n "${NAMESPACE}" \
22-
--type=json -p='[{"op":"remove","path":"/metadata/finalizers"}]' 2>/dev/null || true
22+
--type=json -p='[{"op":"replace","path":"/metadata/finalizers","value":[]}]' 2>/dev/null || true
2323
kubectl delete postgrescluster crunchy-source -n "${NAMESPACE}" \
2424
--ignore-not-found || true
2525

e2e-tests/tests/migration-from-crunchy-standby/99-cleanup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ commands:
2222
# Strip finalizers so deletion is not blocked by a missing operator
2323
kubectl delete postgrescluster crunchy-source -n "${CRUNCHY_NS}" --ignore-not-found || true
2424
kubectl patch postgrescluster crunchy-source -n "${CRUNCHY_NS}" \
25-
--type=json -p='[{"op":"remove","path":"/metadata/finalizers"}]' 2>/dev/null || true
25+
--type=json -p='[{"op":"replace","path":"/metadata/finalizers","value":[]}]' 2>/dev/null || true
2626
2727
helm uninstall pgo --namespace "${CRUNCHY_NS}" --ignore-not-found || true
2828
kubectl delete namespace "${CRUNCHY_NS}" --ignore-not-found || true

0 commit comments

Comments
 (0)