Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic assignment of custom schema name if defined in update-password job #31146

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions bitnami/postgresql/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Changelog

## 16.3.4 (2024-12-23)
## 16.3.5 (2024-12-23)

* [bitnami/postgresql] Release 16.3.4 ([#31143](https://github.com/bitnami/charts/pull/31143))
* Dynamic assignment of custom schema name if defined in update-password job ([#31146](https://github.com/bitnami/charts/pull/31146))

## <small>16.3.4 (2024-12-23)</small>

* [bitnami/postgresql] Release 16.3.4 (#31143) ([05a9583](https://github.com/bitnami/charts/commit/05a9583f949b49fab2673774a4f56ff686d959f4)), closes [#31143](https://github.com/bitnami/charts/issues/31143)

## <small>16.3.3 (2024-12-20)</small>

Expand Down
2 changes: 1 addition & 1 deletion bitnami/postgresql/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ maintainers:
name: postgresql
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/postgresql
version: 16.3.4
version: 16.3.5
5 changes: 3 additions & 2 deletions bitnami/postgresql/templates/update-password/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ spec:
args:
- |
{{- $customUser := include "postgresql.v1.username" . }}
{{- $customDatabase := include "postgresql.v1.database" | default "postgres" }}
{{- if .Values.usePasswordFiles }}
# We need to load all the secret env vars to the system
for file in $(find /bitnami/postgresql/secrets -type f); do
Expand Down Expand Up @@ -87,7 +88,7 @@ spec:
info "User password already updated. Skipping"
else
info "Updating user password"
echo "ALTER USER {{ $customUser }} WITH PASSWORD '$POSTGRESQL_NEW_PASSWORD';" | postgresql_remote_execute $primary_host {{ .Values.containerPorts.postgresql }} "postgres" $POSTGRESQL_USER $POSTGRESQL_PREVIOUS_PASSWORD
echo "ALTER USER {{ $customUser }} WITH PASSWORD '$POSTGRESQL_NEW_PASSWORD';" | postgresql_remote_execute $primary_host {{ .Values.containerPorts.postgresql }} "{{ $customDatabase }}" $POSTGRESQL_USER $POSTGRESQL_PREVIOUS_PASSWORD
touch /job-status/password-changed
info "User password successfully updated"
fi
Expand All @@ -97,7 +98,7 @@ spec:
info "Replication password already updated. Skipping"
else
info "Updating replication password"
echo "ALTER USER $POSTGRESQL_REPLICATION_USER WITH PASSWORD '$POSTGRESQL_NEW_REPLICATION_PASSWORD';" | postgresql_remote_execute $primary_host {{ .Values.containerPorts.postgresql }} "postgres" $POSTGRESQL_REPLICATION_USER $POSTGRESQL_PREVIOUS_REPLICATION_PASSWORD
echo "ALTER USER $POSTGRESQL_REPLICATION_USER WITH PASSWORD '$POSTGRESQL_NEW_REPLICATION_PASSWORD';" | postgresql_remote_execute $primary_host {{ .Values.containerPorts.postgresql }} "{{ $customDatabase }}" $POSTGRESQL_REPLICATION_USER $POSTGRESQL_PREVIOUS_REPLICATION_PASSWORD
touch /job-status/replication-password-changed
info "Replication password successfully updated"
fi
Expand Down
Loading