fix(ci): guard apparmor userns sysctl in deploy workflow

This commit is contained in:
sam committed 2026-10-12 04:17:11 +11:00
1 parent 8a3ba32c5a
commit 2df2f72fc2
1 file changed
+5 -1
+5 -1
View File
@@ -85,7 +85,11 @@ jobs:
# Extensions run in an unprivileged user and network namespace, which
# Ubuntu 24.04 runners forbid through AppArmor by default.
- name: Allow unprivileged user namespaces
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
run: |
if [ -e /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
fi
unshare --user --map-root-user --net true
# The gate's uncached `go test ./...` runs the Docker-backed tests that
# -short skips, and those start a container from alpine:3. A fresh runner