Mirror secret label value contains invalid '/' character (blocks #304/#310 apply) #315
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#315
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Type
Bug
Lineage
Discovered scope from operator-side
make tofu-applyattempt (2026-04-26 by Ava). PR #310 introduced amirror-oflabel on the new mirror secret with valuebasketball-api/admin-app-db-url. Tofu validate passed (syntax-OK) but k8s API rejects on apply because label values can't contain/. Bug landed unblocked because no apply was attempted between merge and now.Repo
forgejo_admin/pal-e-platform
What Broke
tofu applyonmodule.database.kubernetes_secret_v1.admin_app_db_url_westside_adminfails with:Source:
terraform/modules/database/main.tfline 309 —"mirror-of" = "basketball-api/admin-app-db-url". The/separator is structurally invalid for k8s label VALUES (it's only valid in the prefix of label KEYS likeapp.kubernetes.io/managed-by).Repro Steps
cd ~/pal-e-platform/terraform && tofu apply(ormake tofu-apply)kubernetes_secret_v1.admin_app_db_url_westside_adminmetadata.0.labelsvalidation error citing/inbasketball-api/admin-app-db-urlExpected Behavior
Apply succeeds, both secrets land (basketball-api/admin-app-db-url + westside-admin/admin-app-db-url with the mirror label).
Environment
terraform/modules/database/main.tfline 309(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?kubernetes(passes validate, fails on apply)User Story
story:admin-row-crud — As the operator running the apply that creates westside-admin's DATABASE_URL secret mirror, I need the label value to be k8s-valid so the apply doesn't fail.
Architecture
arch:postgres
Context
The label was meant to document provenance (which source secret this mirrors). Using
/as a separator is intuitive but invalid in label values. Replace with.(matches the convention used in label KEYS) or remove the label entirely (themirror-ofsemantic is also captured by thelocal.admin_app_database_urlreference shared between source and mirror).This is the second post-merge runtime gap discovered during apply (the first was salt master being down for 12 days). Worth a follow-up convention: any new k8s resource PR should include a successful
tofu plan -lock=falseagainst real state OR an explicit "apply not yet attempted" flag in the PR body so reviewers know runtime hasn't been exercised.File Targets
terraform/modules/database/main.tfline 309 — changebasketball-api/admin-app-db-urltobasketball-api.admin-app-db-urlAcceptance Criteria
tofu applysucceeds on the mirror secret resourcemirror-ofpresent on the resulting secret with k8s-valid valueTest Expectations
cd terraform && tofu applyproceeds past the mirror secret resourcekubectl get secret admin-app-db-url -n westside-admin --show-labelsshows the new labelConstraints
Checklist
Closes #THISRelated
feedback_verification_before_completion(PR #310's tests didn't exercise apply against k8s)