Fix westside-app prod: Harbor robot account scope mismatch (4 alerts) #110
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
forgejo_admin/pal-e-platform#110
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
plan-pal-e-platform→ Platform Hardening → Harbor robot account scoping fixRepo
forgejo_admin/pal-e-servicesWhat Broke
westside-app prod has been down ~36 hours. Pod is in
ImagePullBackOffwith 401 Unauthorized. The image exists in Harbor projectwestside-app, but the robot account is scoped to Harbor projectwestsidekingsandqueens(derived from the service key ink3s.tfvars).Root cause:
services.tfcreates Harbor projects namedeach.keyand scopes robot accounts to that project. Butimage_repocan point to a different Harbor project (e.g.,westside-app/app→ projectwestside-app, notwestsidekingsandqueens). The naming convention is implicit, not enforced in code.Affected services:
westsidekingsandqueens: key=westsidekingsandqueens, image_repo=westside-app/app→ BROKEN (401)mcd-tracker-app: key=mcd-tracker-app, image_repo=mcd-tracker/app→ LATENT (will break on next CI deploy)Repro Steps
kubectl get pods -n westsidekingsandqueens→ ImagePullBackOffkubectl describe pod -n westsidekingsandqueens <pod>→ 401 Unauthorizedskopeo inspect --creds robot$westsidekingsandqueens-pull:<secret> docker://harbor.tail5b443a.ts.net/westside-app/app:latest→ unauthorizedExpected Behavior
Robot accounts should be scoped to the Harbor project that
image_repopoints to, not to a project named after the service key.Environment
Design Decision: Option B (systemic fix)
Decision: Fix
services.tfto derive the Harbor project name fromimage_repoinstead ofeach.key. This makes the mismatch structurally impossible.Use
split("/", each.value.image_repo)[0]to extract the Harbor project name. Apply to:harbor_project.servicenameharbor_robot_account.service_cinamespaceharbor_robot_account.service_pullnamespaceThis fixes westside AND mcd-tracker AND any future service with a mismatched key/image_repo.
File Targets
Files to modify:
~/pal-e-services/terraform/services.tf— derive Harbor project name fromimage_repousingsplit("/", each.value.image_repo)[0]for project name and robot account scoping (lines 11, 48, 72)Files NOT to touch:
~/pal-e-services/terraform/k3s.tfvars— service keys stay as-is~/pal-e-platform/terraform/— this is a pal-e-services issue~/westside-app/— no CI config changes needed with Option B~/pal-e-deployments/— image references are correct alreadyAcceptance Criteria
curl -s https://westsidekingsandqueens.tail5b443a.ts.netreturns SPA HTMLkubectl get pods -n westsidekingsandqueensshows Running, Readyskopeo inspectwith robot credentials succeeds againstwestside-app/appimage_repoproject component for ALL servicestofu planshows no robot account scope drift for any serviceTest Expectations
tofu plan -lock=falseshows expected changes (project renames + robot rescoping)tofu apply -lock=falsesucceedskubectl get pods -n westsidekingsandqueensshows Running after applykubectl get pods -n mcd-tracker-appstill Running (no regression)Constraints
tofu apply -lock=falserequired (state lock blocks CI)Checklist
tofu planreviewedtofu applysucceedsRelated
pal-e-platform— project board trackingScope Review: NEEDS_REFINEMENT
Review note:
review-189-2026-03-18Root cause verified — robot scope mismatch confirmed in code. Three refinements needed:
westside-app/.woodpecker.yamlandpal-e-deploymentskustomization image refs. Enumerate all affected files explicitly.Scope Refinement (post-review)
Decision: Option A (targeted fix). Align
image_repoto match the Terraform-created Harbor project. Option B (fix services.tf robot scoping) deferred as a separate hardening ticket.Changes from review feedback:
Added: CI push side
Woodpecker pipelines #19 and #20 on
forgejo_admin/westside-appare also failing because the CI push robot has the same scope mismatch. Added acceptance criterion for CI pipeline success.Decision made: Option A
Change
image_repofromwestside-app/apptowestsidekingsandqueens/appink3s.tfvars. Update CI push target and kustomization image references to match.Complete file targets (Option A)
~/pal-e-services/terraform/k3s.tfvarsline 34 — changeimage_repo = "westside-app/app"toimage_repo = "westsidekingsandqueens/app"~/pal-e-deployments/overlays/westsidekingsandqueens/prod/kustomization.yaml— update image reference fromharbor.tail5b443a.ts.net/westside-app/apptoharbor.tail5b443a.ts.net/westsidekingsandqueens/app~/westside-app/.woodpecker.yaml— update CI push target fromwestside-app/apptowestsidekingsandqueens/apptofu apply -lock=falsein pal-e-services after tfvars change to create the new Harbor project and robotUpdated acceptance criteria
curl -s https://westsidekingsandqueens.tail5b443a.ts.netreturns SPA HTMLScope Review: NEEDS_REFINEMENT
Review note:
review-189-2026-03-18-westside-harborTicket is well-structured (all template sections present, file targets verified, acceptance criteria automatable) but cannot be dispatched without a design decision and blast radius update.
mcd-tracker-apphas the identical key/image_repo mismatch (mcd-tracker-appkey,mcd-tracker/appimage_repo) — currently masked but will break on next CI deploynext_upaddresses the same class of bug — should be referenced and coordinated~/westside-app/.woodpecker.yamlmust be added to File Targets (pushes towestside-app/app, would need second PR in different repo)mcd-tracker-appfix and document howservices.tfwill parse project prefix fromimage_repoScope Review: READY
Review note:
review-189-2026-03-18-v2Refined scope (Option A, complete file targets, CI push side added) addresses all v1 findings. All 4 file targets verified against codebase. Design decision made. Acceptance criteria automatable.
mcd-tracker-apphas the same key/image_repo mismatch (masked today, image updater annotation wrong). Flag for #171 or new ticket.