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

Logical backup secret results in duplicate environment keys #2716

Closed nickmansrob closed 2 months ago

nickmansrob commented 3 months ago

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

When generating the cronjob for the logical backup when using Azure, the account key gets fetched form the OperatorConfiguration, even when it's empty. This happens here. I pass it through a SOPS encrypted secret, and this results in a duplicate environment entry in the cronjob with following kubernetes warning:

Warning: spec.template.spec.containers[0].env[16]: hides previous definition of "LOGICAL_BACKUP_AZURE_STORAGE_ACCOUNT_KEY"

Everything still works so this is a low priority bug.

A check should be added for Azure and GCP in the same way this is done for AWS.

I can fix this in a PR if needed and if I find the time.

FxKu commented 3 months ago

A PR to fix it is more than welcome :+1:

FxKu commented 2 months ago

Fix has been merged