fix(database): k8s-valid label value for mirror-of (#315) #316
No reviewers
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/pal-e-platform!316
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "315-fix-mirror-label-value"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replace
/with.in themirror-oflabel value onkubernetes_secret_v1.admin_app_db_url_westside_admin. K8s API rejects/in label values; tofu validate doesn't catch it.Why
PR #310 added the mirror secret with label
mirror-of = "basketball-api/admin-app-db-url". K8s label VALUES (vs label key prefixes likeapp.kubernetes.io/managed-by) cannot contain/per the k8s validation regex(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?. The/was meant as anamespace/namereference; replacing with.preserves intent and passes validation.Discovered when Ava ran
make tofu-applyafter Lucas's "do it" auth — apply errored on this resource. Pre-merge tofu validate passed because it's syntactically valid HCL. Only runtime k8s API validation surfaces it.Changes
terraform/modules/database/main.tfline 309 — change"basketball-api/admin-app-db-url"to"basketball-api.admin-app-db-url"Test Plan
tofu plan -lock=false -var-file=k3s.tfvars(in worktree) shows the resource still planned with new labeltofu applyproceeds pastkubernetes_secret_v1.admin_app_db_url_westside_adminwithout label errorkubectl get secret admin-app-db-url -n westside-admin --show-labelsshowsmirror-of=basketball-api.admin-app-db-urlReview Checklist
namespace.nameinstead ofnamespace/name)story:admin-row-crud,arch:postgres)Related Notes
tofu applyagainst state, not justtofu validate. Worth a follow-up to convention.feedback_verification_before_completionCloses #315
PR #316 Review
DOMAIN REVIEW
Tech stack: Terraform / Kubernetes (kubernetes_secret_v1).
terraform/modules/database/main.tfline 309 — no collateral.mirror-ofis unprefixed (bare key), which is valid; bare keys do not allow/in their values either, so the fix is correct.basketball-api.admin-app-db-urlsatisfies k8s label value regex(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?— starts/ends alphanumeric, only contains-,., alphanumerics, well under 63 chars.namespace.namesubstitution fornamespace/nameretains provenance intent. Downstream consumers (label selectors, kubectl queries) need to use the dot form — no consumers exist yet, so no breakage.BLOCKERS
None.
NITS
SOP COMPLIANCE
315-fix-mirror-label-value(issue-prefixed)Closes #315presentPROCESS OBSERVATIONS
Tight cycle time, minimal blast radius, unblocks
tofu applyfor PR #304 plan run. Change failure risk near zero. Reinforces the "apply-against-state" verification gap noted in PR body — worth a convention note as discovered scope.VERDICT: APPROVED