Skip to content

Commit cfdc6b2

Browse files
deprecate: mark postgres_keep_pvc_after_upgrade deprecated and remove implementation (#352)
Mark postgres_keep_pvc_after_upgrade as (Deprecated) in the CRD spec. Remove the PVC deletion task, CSV specDescriptor, role default, and upgrading.md usage example. The field remains in the CRD to avoid breaking existing CRs. Old Postgres PVC is always preserved after upgrade, consistent with standard behavior across platform operators. Assisted by: Claude Signed-off-by: James Marshall <jamarsha@redhat.com>
1 parent 0ca356d commit cfdc6b2

5 files changed

Lines changed: 1 addition & 30 deletions

File tree

config/crd/bases/eda.ansible.com_edas.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2389,7 +2389,7 @@ spec:
23892389
Default: "prefer"'
23902390
type: string
23912391
postgres_keep_pvc_after_upgrade:
2392-
description: Specify whether or not to keep the old PVC after PostgreSQL upgrades
2392+
description: "(Deprecated) Specify whether or not to keep the old PVC after PostgreSQL upgrades"
23932393
type: boolean
23942394
storage_requirements:
23952395
description: Storage requirements for the PostgreSQL container

config/manifests/bases/eda-server-operator.clusterserviceversion.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,6 @@ spec:
359359
path: database.priority_class
360360
x-descriptors:
361361
- urn:alm:descriptor:com.tectonic.ui:advanced
362-
- displayName: Should PostgreSQL data for managed databases be kept after upgrades?
363-
path: database.postgres_keep_pvc_after_upgrade
364-
x-descriptors:
365-
- urn:alm:descriptor:com.tectonic.ui:advanced
366-
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
367362
- displayName: API Image
368363
path: image
369364
x-descriptors:

docs/upgrade/upgrading.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,3 @@ Starting with this version, the EDA operator **no longer deploys or uses Redis**
6666
> **Note:** The `redis` fields remain in the CRD schema for backward compatibility but are marked as deprecated. They will be removed in a future `apiVersion`.
6767
6868
For more details, see the [Redis Deprecation Notice](../user-guide/redis-configuration.md).
69-
70-
#### PostgreSQL Upgrade Considerations
71-
72-
If there is a PostgreSQL major version upgrade, after the data directory on the PVC is migrated to the new version, the old PVC is kept by default.
73-
This provides the ability to roll back if needed, but can take up extra storage space in your cluster unnecessarily. By default, the postgres pvc from the previous version will remain unless you manually remove it, or have the `database.postgres_keep_pvc_after_upgrade` parameter set to false. You can configure it to be deleted automatically
74-
after a successful upgrade by setting the following variable on the EDA spec.
75-
76-
```yaml
77-
spec:
78-
database:
79-
postgres_keep_pvc_after_upgrade: false
80-
```

roles/postgres/defaults/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ _database:
4141
tolerations: []
4242
postgres_extra_args: '' # Deprecated
4343
postgres_extra_settings: [] # Define postgresql.conf configurations
44-
postgres_keep_pvc_after_upgrade: true # Specify whether or not to keep the old PVC after PostgreSQL upgrades
4544
postgres_data_volume_init: false
4645
postgres_init_container_commands: |
4746
chown 26:0 /var/lib/pgsql/data

roles/postgres/tasks/upgrade_postgres.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,3 @@
168168
loop:
169169
- "{{ ansible_operator_meta.name }}-postgres-13"
170170

171-
- name: Remove old persistent volume claim
172-
k8s:
173-
kind: PersistentVolumeClaim
174-
api_version: v1
175-
namespace: "{{ ansible_operator_meta.namespace }}"
176-
name: "{{ item }}"
177-
state: absent
178-
loop:
179-
- "postgres-{{ ansible_operator_meta.name }}-postgres-13-0"
180-
- "postgres-13-{{ ansible_operator_meta.name }}-postgres-13-0"
181-
when: not combined_database.postgres_keep_pvc_after_upgrade | bool

0 commit comments

Comments
 (0)