fix(registry): let assemble-htpasswd run again in place #11
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/htpasswd-rerun"
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?
When the kubelet restarts the zot pod in place (node reboot, kubelet restart), the
assemble-htpasswdinit container runs again over the emptyDir that already holds the 0440htpasswdfrom the first run. The container runs as uid 902, so: > /output/htpasswdfails withPermission deniedand the pod never leaves Init.This happened today: seanfarm-worker-a40389 rebooted at 22:27 UTC (hung NVMe-oF I/O from the retired d87376 node), the init container went into CrashLoopBackOff, and the registry answered 503 until the pod was deleted by hand.
Fix: build the file next to the old one and
mv -fit over. Rename needs only directory write access and is atomic.Red-green:
tests/zot-htpasswd-rerun.shruns the real init script twice against one output directory as a non-root user. It fails on trunk (Permission denied) and passes with this change.tests/check.shis green.https://claude.ai/code/session_01LeVatedQ4sCA1u6LHjo7B5