zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.37k stars 980 forks source link

changing additionalVolumes does not trigger StatefulSet update #2761

Open coopstah13 opened 2 months ago

coopstah13 commented 2 months ago

Please, answer some short questions which should help us to understand your problem / question better?

The fix performed for #1458 is incomplete. There is only a check for a difference of number of volumes, but not if the volumes themselves change.

For example, if you have

  additionalVolumes:
  - mountPath: /certs/minio
    name: minio-ca-cert
    targetContainers: []
    volumeSource:
      secret:
        secretName: minio-ca-cert

and you change it to (note the change to the secretName)

  additionalVolumes:
  - mountPath: /certs/minio
    name: minio-ca-cert
    targetContainers: []
    volumeSource:
      secret:
        secretName: minio-ca-cert-2

The operator does not pick up this change, because the volume count stays the same, and it only checks for differences in the volume mounts (which are the same in this case).