Remove deprecated westside-admin references from Terraform #412
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#412
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 during
tofu applyfor paldocs NetworkPolicy fix (PR #398). Apply fails on 1 resource targeting the non-existentwestside-adminnamespace.Repo
ldraney/pal-e-platformWhat Broke
tofu applyfails withnamespaces "westside-admin" not foundon:module.database.kubernetes_secret_v1.admin_app_db_url_westside_admin(mirrors admin-app-db-url intowestside-admin)The
westside-adminnamespace was deprecated and removed. The mirror secret resource (PR #310) was never successfully applied.Additionally,
module.database.kubernetes_job_v1.admin_app_user_provisionprovisions anadmin_appPostgres role on the basketball-api database for westside-admin. If westside-admin is fully deprecated, this job and theadmin_app_db_urlsecret in basketball-api should also be removed.Repro Steps
tofu plan -lock=falseinpal-e-platform/terraformwestside-adminnamespace that will fail on applyExpected Behavior
No references to deprecated
westside-adminnamespace or its associated database role provisioning.Environment
westside-adminnamespace does not existterraform/modules/database/main.tf(lines 116, 262, 301, 317)Acceptance Criteria
admin_app_db_url_westside_adminresource removed frommodules/database/main.tfadmin_app_user_provisionjob removed (if westside-admin is fully deprecated)admin_app_db_urlsecret in basketball-api removed (if no other consumers)data.kubernetes_namespace_v1.westside_admindata source removed if no longer referencedtofu state rmrun for any resources in state that are being deleted from codetofu planshows no resources targetingwestside-adminRelated
Ticket #412 Review
SCOPE ASSESSMENT
The issue is well-scoped as a targeted Terraform cleanup: remove resources that reference the deprecated
westside-adminnamespace so thattofu applystops failing. The lineage (discovered during PR #398) and repro steps are clear.FILE TARGET VERIFICATION
The issue cites
terraform/modules/database/main.tflines 116, 262, 301, 317. I verified these targets against themainbranch:kubernetes_job_v1.admin_app_user_provisionkubernetes_secret_v1.admin_app_db_urllocals.admin_app_database_urlkubernetes_secret_v1.admin_app_db_url_westside_admindata.kubernetes_namespace_v1.westside_adminAll five targets exist on
mainand referencewestside-admin.ACCEPTANCE CRITERIA REVIEW
The AC items are reasonable but have two gaps:
Gap 1 -- Incomplete file scope. The AC only targets
main.tfresources, butwestside-adminreferences also exist in:terraform/modules/database/outputs.tf--admin_app_db_url_namespacesoutput referencesadmin_app_db_url_westside_admin; description says "mirrored into both basketball-api and westside-admin namespaces"terraform/modules/database/variables.tf-- description onadmin_app_db_passwordsays "Consumers: westside-admin (Track B)"scripts/woodpecker-update-tag-step.yaml-- overlay mappingwestside-admin -> OVERLAY=westside-adminThe outputs.tf gap is a potential blocker: removing
admin_app_db_url_westside_adminfrom main.tf while outputs.tf still references it will cause a Terraform validation error. The variables.tf and scripts references are comment-level and less urgent but should be cleaned for accuracy.Gap 2 -- admin_app role scope ambiguity. The AC says "Remove
admin_app_user_provisionjob (if westside-admin deprecated)" and "Removeadmin_app_db_urlsecret in basketball-api (if no other consumers)." These conditionals are appropriate but need a decision recorded in the ticket. Theadmin_app_db_passwordvariable has a deep footprint across 7+ files (Woodpecker CI secrets, Salt pillar, Makefile, root terraform variables). If the admin_app Postgres role is ONLY used by westside-admin, the full cleanup is much larger than the AC suggests. If basketball-api itself also uses this role, then only the westside-admin mirror secret should be removed. The ticket should document which case applies.RELATED ISSUE OVERLAP
Issue #374 ("Remove stale projects: mcd-tracker, westside-admin, capacitor-mobile") also tracks westside-admin removal. This ticket (#412) is more narrowly scoped to the Terraform-blocking resources, which is fine, but the relationship should be documented in the Related section to avoid duplicate work.
SOP COMPLIANCE
412-remove-deprecated-westside-admin-referen(follows convention, truncated by Forgejo)RECOMMENDATIONS
outputs.tfto the AC -- removing theadmin_app_db_url_westside_adminresource without updatingoutputs.tfwill breaktofu validate.admin_appPostgres role and itsadmin_app_db_urlsecret in basketball-api have consumers beyond westside-admin. If not, the AC should expand to cover the full admin_app teardown (or spawn a follow-up issue). If yes, narrow the AC to only the westside-admin mirror.scripts/woodpecker-update-tag-step.yamlto AC -- the westside-admin overlay mapping is stale.VERDICT: NEEDS_WORK
The core scope is correct and the issue is close to ready, but the outputs.tf omission will cause a Terraform validation failure if not addressed in the AC, and the admin_app role scope question needs a documented decision before implementation begins.