Apps fronted by valkey-operator instances need the same wait-for-ready
initContainer postgres workloads already get, and wiring per-field
secretKeyRefs for operator-generated secrets is boilerplate. waitfordb
now speaks enough RESP to AUTH and PING, and natively understands the
secret shapes CNPG and valkey-operator generate so an initContainer is
just envFrom plus a mode variable.
- valkey driver (alias: redis): fresh TCP connection per attempt,
optional AUTH (ACL user or default), PING, reusing the existing
retry/backoff wait loop; redis:///valkey:// DSNs; default port 6379
- WAITFORDB_SECRET_FORMAT=cnpg|valkey for envFrom-injected operator
secrets: CNPG <cluster>-app host/port/dbname/user/password keys, and
valkey-operator key-per-username secrets (_operator preferred, or
WAITFORDB_USER's same-named key)
- autodetection from injected keys (CNPG keys -> postgres, valkey keys
-> valkey); explicit WAITFORDB_DRIVER/WAITFORDB_* always win, PG*
fallback and all existing flags unchanged
- valkey needs no user/database to be valid (unauthenticated PING)
- tests: secret shape parsing/autodetect/mismatch, fake RESP server
covering NOAUTH/WRONGPASS/ACL auth/DSN, retry-until-up wait
- README: envFrom initContainer snippets for CNPG and valkey-operator
Each Woodpecker workflow file maps to one ci/woodpecker/pr/<file> status
context, so break the single build.yaml into three PR workflows to expose
three separate PR checks:
- .woodpecker/pre-commit.yaml runs the pre-commit hooks via make pre-commit.
- .woodpecker/test.yaml runs make test (go test ./...).
- .woodpecker/build.yaml keeps only the container dry-run build-check.
Add .pre-commit-config.yaml (gofmt/go vet/go unit tests + whitespace/yaml
hooks) and a make pre-commit target. docker.yaml (tag release) is unchanged.
Small Go tool + distroless container used as a K8s initContainer to block an
app until its database (Postgres/MySQL) is reachable. Env-var configured
(WAITFORDB_* + libpq PG* fallback), configurable timeout/interval, redacted
logs, exit codes. Woodpecker CI publishes docker-internal/waitfordb on tag.