Skip to content

BUG: PostgreSQL database-init hook does not pass password to psql #220

Closed
digital-bank-java/infra-sit
#33

Description

@ramioooz

Parent: EPIC: Sprint 0 - Platform Foundation and Local SIT #18

Symptom

The PostgreSQL post-install,post-upgrade database initialization hook reaches postgres:5432 but psql prompts for a password and fails authentication. The existing StatefulSet and PVC remain healthy.

Root cause

The hook receives POSTGRES_PASSWORD through the Kubernetes Secret, but the PostgreSQL client requires the password through PGPASSWORD (or an equivalent password-file mechanism).

Scope

  • Inject PGPASSWORD from the existing Secret key POSTGRES_PASSWORD into the init Job.
  • Keep credentials out of chart values, logs, rendered documentation, and issue comments.
  • Add a Helm-render validation that the client password reference is present.
  • Verify an upgrade completes and all existing logical databases remain intact.

Acceptance criteria

  • Helm lint and template validation pass.
  • The database-init hook completes successfully against the existing SIT PostgreSQL instance.
  • The PostgreSQL StatefulSet and PVC are not deleted or replaced.
  • No secret values are printed or committed.

Evidence

The failed upgrade is revision 4 of the postgres release in digital-bank-sit; the StatefulSet is 1/1 and the existing data-postgres-0 PVC is Bound.

Service: infra-sit
Priority: P0
Assignee: ramioooz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions