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

bitnami/postgresql Fix missing dot in include statement for passwordUpdate job template #31364

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

nix-power
Copy link
Contributor

@nix-power nix-power commented Jan 14, 2025

Description of the change

Benefits

Fix missing dot in include statement for passwordUpdate job template

Error: template: idp/charts/keycloak/charts/postgresql/templates/update-password/job.yaml:60:37: 
executing "idp/charts/keycloak/charts/postgresql/templates/update-password/job.yaml" 
at <include>: wrong number of args for include: want 2 got 1

Possible drawbacks

Applicable issues

  • fixes # Bug of rendering of paswordUpdate job

Additional information

Chart has been rendered locally (as a subchart of keycloak) and the issue appears fixed

# Source: idp/charts/keycloak/charts/postgresql/templates/update-password/job.yaml
apiVersion: batch/v1
kind: Job
metadata:
  name: idp-postgresql-password-update
  namespace: "idp"
  labels:
    app.kubernetes.io/instance: idp
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: postgresql
    app.kubernetes.io/version: 17.2.0
    helm.sh/chart: postgresql-16.4.2
    app.kubernetes.io/part-of: postgresql
    app.kubernetes.io/component: update-job
  annotations:
    helm.sh/hook: pre-upgrade
    helm.sh/hook-delete-policy: hook-succeeded
spec:
  backoffLimit: 10
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: idp
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/name: postgresql
        app.kubernetes.io/version: 17.2.0
        helm.sh/chart: postgresql-16.4.2
        app.kubernetes.io/part-of: postgresql
        app.kubernetes.io/component: update-job
    spec:

      restartPolicy: OnFailure
      securityContext:
        fsGroup: 1001
        fsGroupChangePolicy: Always
        supplementalGroups: []
        sysctls: []
      automountServiceAccountToken: false
      initContainers:
      containers:
        - name: update-credentials
          image: rt.imperva-services.net/docker/postgresql:16.6.0-debian-12-r2
          imagePullPolicy: Always
          command:
            - /bin/bash
            - -ec
          args:
            - |

              . /opt/bitnami/scripts/postgresql-env.sh
              . /opt/bitnami/scripts/libpostgresql.sh
              . /opt/bitnami/scripts/liblog.sh

              primary_host=idp-postgresql-0.idp-postgresql-hl
              info "Starting password update job"
              if [[ -f /job-status/postgres-password-changed ]]; then
                  info "Postgres password already updated. Skipping"
              else
                  info "Updating postgres password"
                  echo "ALTER USER postgres WITH PASSWORD '$POSTGRESQL_NEW_POSTGRES_PASSWORD';" | postgresql_remote_execute $primary_host 5432 "" postgres $POSTGRESQL_PREVIOUS_POSTGRES_PASSWORD
                  touch /job-status/postgres-password-changed
                  info "Postgres password successfully updated"
              fi
              if [[ -f /job-status/password-changed ]]; then
                  info "User password already updated. Skipping"
              else
                  info "Updating user password"
                  echo "ALTER USER ico_keycloak WITH PASSWORD '$POSTGRESQL_NEW_PASSWORD';" | postgresql_remote_execute $primary_host 5432 "keycloak" $POSTGRESQL_USER $POSTGRESQL_PREVIOUS_PASSWORD
                  touch /job-status/password-changed
                  info "User password successfully updated"
              fi
              info "Password update job finished successfully"

Checklist

  • [ X] Chart version bumped in Chart.yaml according to semver. This is not necessary when the changes only affect README.md files.
  • Variables are documented in the values.yaml and added to the README.md using readme-generator-for-helm
  • [ X] Title of the pull request follows this pattern [bitnami/<name_of_the_chart>] Descriptive title
  • [ X] All commits signed off and in agreement of Developer Certificate of Origin (DCO)

Signed-off-by: Dima Zyuryaev <[email protected]>
@nix-power
Copy link
Contributor Author

If possible, please prioritize this.

@nix-power nix-power marked this pull request as ready for review January 14, 2025 18:12
Signed-off-by: Bitnami Containers <[email protected]>
@carrodher carrodher added verify Execute verification workflow for these changes in-progress labels Jan 14, 2025
@github-actions github-actions bot removed the triage Triage is needed label Jan 14, 2025
@github-actions github-actions bot removed the request for review from javsalgar January 14, 2025 21:05
@github-actions github-actions bot requested a review from dgomezleon January 14, 2025 21:05
Copy link
Member

@carrodher carrodher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@carrodher carrodher enabled auto-merge (squash) January 14, 2025 21:05
@carrodher carrodher merged commit 901b26c into bitnami:main Jan 14, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postgresql solved verify Execute verification workflow for these changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants