Skip to content

fix(api-server): default DB secret paths to in-pod mount location - #446

Open
bsquizz wants to merge 2 commits into
mainfrom
fix/seed-admin-db-defaults
Open

fix(api-server): default DB secret paths to in-pod mount location#446
bsquizz wants to merge 2 commits into
mainfrom
fix/seed-admin-db-defaults

Conversation

@bsquizz

@bsquizz bsquizz commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • seed-admin and encrypt-credentials subcommands inherit upstream rh-trex-ai defaults (secrets/db.host) which don't match the API server pod's volume mount at /secrets/db/db.host, requiring every caller to pass explicit --db-*-file flags
  • Extract a shared setInPodDBDefaults helper that overrides the defaults to /secrets/db/db.*
  • Remove the now-redundant --db-*-file flags from the bootstrap-admin Job manifest

Spec impact

None — no specs reference seed-admin, the bootstrap job, or DB secret paths.

Test plan

  • kubectl exec into API server pod and run seed-admin --username test without --db-*-file flags — should connect to DB successfully
  • Verify bootstrap-admin Job still works on fresh deployment (no explicit DB path flags needed)
  • go build ./... passes in components/ambient-api-server/

🤖 Generated with Claude Code

@YiqinZhang

Copy link
Copy Markdown

🤖 Amber Review

Fixes incorrect DB secret file paths: upstream rh-trex-ai defaults to secrets/db.host (no leading slash), but in-pod mounts are at /secrets/db/db.host. Extracts setInPodDBDefaults() helper called in both seed_admin.go and encrypt_credentials.go, removes redundant --db-*-file flags from the bootstrap Job manifest.

Findings:

  • Minor: No unit test for setInPodDBDefaults — the function is trivial (five string assignments) and a table-driven test would prevent future regressions cheaply.

Correct, DRY improvement. No security surface touched, no tokens involved. Logic is trivially verifiable by inspection.

Confidence: High


— Amber, ACP codebase intelligence

@bsquizz
bsquizz force-pushed the fix/seed-admin-db-defaults branch from adb12b0 to abcb512 Compare August 3, 2026 14:24
bsquizz and others added 2 commits August 3, 2026 10:25
The seed-admin and encrypt-credentials subcommands inherit upstream
rh-trex-ai defaults (secrets/db.host) which don't match the API server
pod's volume mount at /secrets/db/db.host. This forced every caller to
pass explicit --db-*-file flags.

Extract a shared setInPodDBDefaults helper that overrides the defaults
to /secrets/db/db.*, and remove the now-redundant flags from the
bootstrap-admin Job manifest.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verifies all five DB secret file path overrides to catch silent
regressions if the mount paths change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bsquizz
bsquizz force-pushed the fix/seed-admin-db-defaults branch from abcb512 to 109cac9 Compare August 3, 2026 14:25
@bsquizz
bsquizz marked this pull request as ready for review August 3, 2026 14:36
@github-actions github-actions Bot added auto-merge-pending PR eligible for auto-merge, waiting for checks component/api-server labels Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

amber/approved auto-merge-pending PR eligible for auto-merge, waiting for checks component/api-server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants