prole/conf
chrisfu 1b08f72538 fix(gitlab): stop AUTOCLEAN from wiping gitaly PVC on every run
Discovered today after the SSH-ingress reconcile: init_gitlab.sh had a
destructive false-positive in its "legacy storage detection" at the
top of setup_gitlab_storage(). The bare check

  if kubectl -n "$NAMESPACE" get pvc repo-data-gitlab-gitaly-0 >/dev/null 2>&1;
    then has_legacy=1; fi

flagged has_legacy=1 whenever the PVC object simply existed — which is
always true after the first successful deploy. Combined with
GITLAB_REPAIR_BLOCKED_AUTOCLEAN=1, every init_gitlab.sh invocation
triggered the "repairing legacy Gitaly storage" branch, which scales
the Gitaly StatefulSet to 0 and deletes repo-data-gitlab-gitaly-0
immediately, wiping all git-repo data.

We caught it when the knoe-db repo (pushed via HTTPS earlier in the
day) disappeared after an unrelated init_gitlab.sh run for SSH ingress
wiring. The PVC age on inspection was ~26 min — newer than the push.
git ls-remote against the project now returns a garbled gzip body,
consistent with an empty gitaly backing an existing DB project.

Fix:
- etc/init_gitlab.sh:setup_gitlab_storage()
  * Remove the bare `pvc exists` legacy check.
  * Keep the real legacy markers: synology PV, gandalf.prole.org
    nodeSelector, gitlab-gitaly-static storageClass on the STS.
  * Add a new check that flags has_legacy=1 only when the PVC's actual
    storageClassName is a known-legacy value (gitlab-gitaly-static or
    synology-iscsi), never on mere existence.
- conf/gke.cfg
  * GITLAB_REPAIR_BLOCKED_AUTOCLEAN: 1 -> 0. The script fix above makes
    re-enabling safe, but the conservative default is to let the user
    see repair_blocked and consent rather than silently wipe data.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 22:51:41 -07:00
..
cnpg-placement checkpoint: make node placement config-driven and add GitLab rerun fast-path 2026-04-14 06:43:37 -07:00
postgresql Refactor to support mode-scoped DB build contexts and versioning 2026-03-22 05:47:50 -07:00
prod refactor(config): separate k3d k3s and gke config entrypoints 2026-04-11 22:20:45 -07:00
service refactor(config): separate k3d k3s and gke config entrypoints 2026-04-11 22:20:45 -07:00
test Rename prole-db to knoe-db, add knoe-auth as cluster-internal KDC 2026-03-22 22:16:21 -07:00
database_versions.json Rename Prole storage objects to Synology and sync deployment updates 2026-03-22 21:50:02 -07:00
gke.cfg fix(gitlab): stop AUTOCLEAN from wiping gitaly PVC on every run 2026-04-20 22:51:41 -07:00
k3d.cfg checkpoint: make node placement config-driven and add GitLab rerun fast-path 2026-04-14 06:43:37 -07:00
k3s.cfg checkpoint: update GKE deployment docs and infra changes 2026-04-18 07:18:10 -07:00
port-mapping.cfg fix(gitlab): unblock standalone reconcile + OIDC + object storage 2026-04-20 18:51:41 -07:00
prole.silent.all.cfg feat: full GKE/prod deployment pipeline from UI to Artifact Registry 2026-04-04 12:38:16 -07:00