summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-08-02 09:08:22 +0300
committerPaul Buetow <paul@buetow.org>2026-08-02 09:08:22 +0300
commitc3bda963abcf5d2bd93f1ad40a07fce715154f5f (patch)
tree7f768b18e8e5cde44e6280cf2fe0b65873022349
parentf6035ac0119fb65fc7ed955932729f3553a1ba6d (diff)
shuriken-sync: guard rsync --delete with NFS sentinel (review fix)
Without an nfs-check initContainer, a run scheduled while NFS is unmounted on the node would see an empty/stale /data source and rsync --delete would wipe the live public site on fishfinger/blowfish. Mirror the generation CronJob's sentinel guard (refuse to start if /mnt/shuriken.sh/.nfs-sentinel is missing). Also run the publish script under /bin/bash for reliable pipefail (ash's is version-gated).
-rw-r--r--f3s/shuriken/helm-chart/templates/sync-cronjob.yaml19
1 files changed, 18 insertions, 1 deletions
diff --git a/f3s/shuriken/helm-chart/templates/sync-cronjob.yaml b/f3s/shuriken/helm-chart/templates/sync-cronjob.yaml
index f3155c6..b24c090 100644
--- a/f3s/shuriken/helm-chart/templates/sync-cronjob.yaml
+++ b/f3s/shuriken/helm-chart/templates/sync-cronjob.yaml
@@ -35,11 +35,28 @@ spec:
template:
spec:
restartPolicy: Never
+ initContainers:
+ - name: nfs-check
+ image: busybox:stable
+ command:
+ - sh
+ - -c
+ - |
+ test -f /mnt/shuriken.sh/.nfs-sentinel || (
+ echo "ERROR: NFS sentinel missing at /mnt/shuriken.sh/.nfs-sentinel"
+ echo "refusing to publish; NFS likely unmounted on this node"
+ echo "rsync --delete against an empty/stale source would wipe the live site"
+ exit 1
+ )
+ volumeMounts:
+ - name: data
+ mountPath: /mnt
+ readOnly: true
containers:
- name: shuriken-sync
image: registry.lan.buetow.org:30001/shuriken:0.13.2
imagePullPolicy: Always
- command: ["/bin/sh", "-c"]
+ command: ["/bin/bash", "-c"]
args:
- |
set -euo pipefail