fix(docker_init): fall back to synthetic name when whoami fails

This commit is contained in:
Erwan Leboucher committed 2026-05-14 18:53:57 +02:00
1 parent e5ca59bc8f
commit d9c7dc6fe2
1 file changed
+2 -1
+2 -1
View File
@@ -25,7 +25,8 @@ export ENV_OBFUSCATE_PART="TOKEN API KEY"
if [ -z "${ENV_IGNORELIST+x}" ]; then error_exit "ENV_IGNORELIST not set"; fi
if [ -z "${ENV_OBFUSCATE_PART+x}" ]; then error_exit "ENV_OBFUSCATE_PART not set"; fi
whoami=`whoami`
# whoami fails under set -e if the UID has no /etc/passwd entry (k8s runAsUser).
whoami=$(whoami 2>/dev/null || echo "uid-$(id -u)")
script_dir=$(dirname $0)
script_name=$(basename $0)
echo ""; echo ""