Open spantaleev opened 4 weeks ago
We can wrap them in a with
statement so they are not included.
I'm also seeing this with a bunch of other entries:
I'm using server-side apply
We also are running into this issue when using v0.1.0
with fleet, as a workaround we put in values so pg_hba
and pg_ident
are not empty arrays and that seems to have resolved it for now...
Added this to our values.yaml
for our cnpg clusters
postgresql:
pg_hba:
- host all all 10.0.0.0/8 trust
pg_ident:
- postgres local postgres
Thanks to @cterence for a better idea, adding below to our fleet deployment for the application also temporarily solves the issue
diff:
comparePatches:
- apiVersion: postgresql.cnpg.io/v1
kind: Cluster
jsonPointers:
- /spec/postgresql/pg_hba
- /spec/postgresql/pg_ident
Adding this ignoreDifferences
block to the Application temporarily solves the issue
- group: postgresql.cnpg.io
kind: Cluster
jqPathExpressions:
- .spec.postgresql.pg_hba
- .spec.postgresql.pg_ident
I submitted a PR for this, which fixes spec.postgresql.pg_hba
, spec.postgresql. pg_ident
and spec.postgresql.parameters
If you encounter other keys like this, please let me know so I can add a fix to the PR.
I'm using the following ArgoCD application:
This generates a
Cluster
resource withpg_hba: []
andpg_ident: []
:ArgoCD continuously retries updating this
Cluster
resource, but the final result lacks thepg_hba
andpg_ident
keys. I suspect it's because they are empty lists.Perhaps the code here could benefit from some
if
statements that excludepg_hba
andpg_ident
if they would end up being empty?https://github.com/cloudnative-pg/charts/blob/3c5dd5d9997592aeb1391b4d11ed2284d68dba31/charts/cluster/templates/cluster.yaml#L63-L66
This only became an issue with version 0.1.0 of the cluster chart. Downgrading to 0.0.11 (which does not have these
pg_hba
andpg_ident
keys) fixes the problem.Seems like
pg_hba
got introduced in https://github.com/cloudnative-pg/charts/pull/321 whilepg_ident
got introduced in https://github.com/cloudnative-pg/charts/pull/377