fix(ops): read DB secret ranch-external-db/uri — ranch-api-env doesn't exist - #24
Merged
Merged
Conversation
…t exist Run 31171799091 failed with 'secret ranch-api-env not found': the live cluster runs the k8s/deploy bootstrap manifests, not k8s/platform — the API's DB connection string lives in secret ranch-external-db, key uri (external database, which also explains why no CNPG cluster exists). Declare both secret candidates as optional env sources and let the exec step use whichever is present, so the workflow survives an eventual migration to the k8s/platform manifests and still fails with a clear message if neither secret exists. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Evidence from run 31171799091
The client pod scheduled and pulled its image fine, then looped on:
Yet
ranch-apiis Running — so the live deployment cannot be the one ink8s/platform/api/deployment.yaml(whichenvFromsranch-api-env). The live cluster runs thek8s/deploybootstrap manifests: 30-api.yaml takesDATABASE_URLfrom secretranch-external-db, keyuri— an external database, which also explains why run 31169336292 found no CNPG cluster.Fix
optional: trueenv sources:ranch-external-db/uri(live today) andranch-api-env/DATABASE_URL(the k8s/platform world, if the cluster ever migrates to it).${DB_URL_EXTERNAL:-$DB_URL_APIENV}) and fails with a clear message if neither exists.optional: truealso means a missing secret can no longer wedge the pod inCreateContainerConfigError— the pod starts, and the error surfaces in the exec step's output instead of a describe dump.Everything else (guards,
\getenvinput passing, cleanup) unchanged.Verification
Next dispatch after merge. The
db target:line in the log will show the credential-stripped host of the external DB — worth noting down, since no repo manifest records where prod's database actually is.🤖 Generated with Claude Code