fix(litefs): simplify candidate env var and add debug logging

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock 2026-01-21 16:50:02 -06:00
parent 42f55855eb
commit 2765b081bc
2 changed files with 3 additions and 1 deletions

View File

@ -16,7 +16,7 @@ data:
lease:
type: "static"
advertise-url: "http://${HOSTNAME}.abaci-app-headless.abaci.svc.cluster.local:20202"
candidate: ${LITEFS_CANDIDATE:-false}
candidate: ${LITEFS_CANDIDATE}
# HTTP proxy to forward writes from replicas to primary
# LiteFS automatically forwards writes to primary via lease advertise-url

View File

@ -137,9 +137,11 @@ resource "kubernetes_stateful_set" "app" {
image = var.app_image
# Override to use LiteFS
# Export LITEFS_CANDIDATE env var and start litefs
command = ["/bin/sh", "-c"]
args = [<<-EOT
export LITEFS_CANDIDATE=$(cat /config/litefs-candidate)
echo "Starting LiteFS with LITEFS_CANDIDATE=$LITEFS_CANDIDATE"
exec litefs mount
EOT
]