From f71e826845eec3a1514908863f0d1a0de6e53728 Mon Sep 17 00:00:00 2001 From: Gabriel Mainberger Date: Fri, 23 Feb 2024 15:32:41 +0100 Subject: [PATCH] Change POSTGRES_DB to POSTGRES_DATABASE Bitnami has changed the POSTGRES_DB variable to POSTGRES_DATABASE. This had no influence on the functionality, but is just wrong now for the Bitnami image used. Ref: https://github.com/bitnami/containers/tree/main/bitnami/postgresql#customizable-environment-variables --- class/defaults.yml | 2 +- docs/modules/ROOT/pages/how-tos/change-passwords.adoc | 2 +- docs/modules/ROOT/pages/how-tos/db-tls.adoc | 2 +- docs/modules/ROOT/pages/how-tos/restore.adoc | 2 +- .../postgresql/templates/primary/statefulset.yaml | 2 +- .../postgresql/templates/primary/statefulset.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/class/defaults.yml b/class/defaults.yml index b65f4fb0..787a68bb 100644 --- a/class/defaults.yml +++ b/class/defaults.yml @@ -303,7 +303,7 @@ parameters: existingSecret: ${keycloak:database:secretname} primary: podAnnotations: - k8up.io/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER" PGPASSWORD="$POSTGRES_PASSWORD" pg_dump --clean' + k8up.io/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DATABASE" PGUSER="$POSTGRES_USER" PGPASSWORD="$POSTGRES_PASSWORD" pg_dump --clean' k8up.io/file-extension: .sql labels: ${keycloak:labels} containerSecurityContext: diff --git a/docs/modules/ROOT/pages/how-tos/change-passwords.adoc b/docs/modules/ROOT/pages/how-tos/change-passwords.adoc index 475d5904..2bc4b773 100644 --- a/docs/modules/ROOT/pages/how-tos/change-passwords.adoc +++ b/docs/modules/ROOT/pages/how-tos/change-passwords.adoc @@ -80,7 +80,7 @@ vault kv patch "${parent}/${instance}" db-password="${db_pass}" namespace=syn-${instance} kubectl -n ${namespace} exec -it keycloak-postgresql-0 -c keycloak-postgresql -- sh -c \ -'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER" PGPASSWORD="'${old_pass}'" '\ +'PGDATABASE="$POSTGRES_DATABASE" PGUSER="$POSTGRES_USER" PGPASSWORD="'${old_pass}'" '\ 'psql -c "ALTER USER keycloak WITH PASSWORD '${db_pass}';"' ---- + diff --git a/docs/modules/ROOT/pages/how-tos/db-tls.adoc b/docs/modules/ROOT/pages/how-tos/db-tls.adoc index f04c7d73..e6c2f3bd 100644 --- a/docs/modules/ROOT/pages/how-tos/db-tls.adoc +++ b/docs/modules/ROOT/pages/how-tos/db-tls.adoc @@ -87,7 +87,7 @@ parameters: ---- namespace=syn-keycloak kubectl exec -it -n ${namespace} keycloak-postgresql-0 -c keycloak-postgresql -- sh -c \ -'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER" PGPASSWORD="$POSTGRES_PASSWORD" '\ +'PGDATABASE="$POSTGRES_DATABASE" PGUSER="$POSTGRES_USER" PGPASSWORD="$POSTGRES_PASSWORD" '\ 'psql -c "SELECT datname, usename, ssl, client_addr FROM pg_stat_ssl JOIN pg_stat_activity ON pg_stat_ssl.pid = pg_stat_activity.pid;"' ---- + diff --git a/docs/modules/ROOT/pages/how-tos/restore.adoc b/docs/modules/ROOT/pages/how-tos/restore.adoc index abe8916d..3cd164f9 100644 --- a/docs/modules/ROOT/pages/how-tos/restore.adoc +++ b/docs/modules/ROOT/pages/how-tos/restore.adoc @@ -112,7 +112,7 @@ export POD=keycloak-postgresql-0 restic dump "${SNAPSHOT_ID}" /$NAMESPACE-keycloak-postgresql.sql \ | kubectl -n $NAMESPACE exec -i $POD \ - -- sh -c 'PGPASSWORD="${POSTGRES_PASSWORD}" psql --set ON_ERROR_STOP=on -U "${POSTGRES_USER}" ${POSTGRES_DB}' + -- sh -c 'PGPASSWORD="${POSTGRES_PASSWORD}" psql --set ON_ERROR_STOP=on -U "${POSTGRES_USER}" ${POSTGRES_DATABASE}' ---- . Re-enable ArgoCD auto sync and scale up Keycloak diff --git a/tests/golden/builtin/builtin/builtin/01_keycloak_helmchart/postgresql/templates/primary/statefulset.yaml b/tests/golden/builtin/builtin/builtin/01_keycloak_helmchart/postgresql/templates/primary/statefulset.yaml index 874cce81..a102b7c9 100644 --- a/tests/golden/builtin/builtin/builtin/01_keycloak_helmchart/postgresql/templates/primary/statefulset.yaml +++ b/tests/golden/builtin/builtin/builtin/01_keycloak_helmchart/postgresql/templates/primary/statefulset.yaml @@ -21,7 +21,7 @@ spec: template: metadata: annotations: - k8up.io/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER" + k8up.io/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DATABASE" PGUSER="$POSTGRES_USER" PGPASSWORD="$POSTGRES_PASSWORD" pg_dump --clean' k8up.io/file-extension: .sql labels: diff --git a/tests/golden/openshift-postgres/openshift-postgres/openshift-postgres/01_keycloak_helmchart/postgresql/templates/primary/statefulset.yaml b/tests/golden/openshift-postgres/openshift-postgres/openshift-postgres/01_keycloak_helmchart/postgresql/templates/primary/statefulset.yaml index 020cda0a..3c5fbeb0 100644 --- a/tests/golden/openshift-postgres/openshift-postgres/openshift-postgres/01_keycloak_helmchart/postgresql/templates/primary/statefulset.yaml +++ b/tests/golden/openshift-postgres/openshift-postgres/openshift-postgres/01_keycloak_helmchart/postgresql/templates/primary/statefulset.yaml @@ -21,7 +21,7 @@ spec: template: metadata: annotations: - k8up.io/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER" + k8up.io/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DATABASE" PGUSER="$POSTGRES_USER" PGPASSWORD="$POSTGRES_PASSWORD" pg_dump --clean' k8up.io/file-extension: .sql labels: