summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-10 11:11:58 +0200
committerPaul Buetow <paul@buetow.org>2026-01-10 11:11:58 +0200
commitdc5b5c0170d839262fc7e68d692668abf5fb4808 (patch)
treeca71a854038f238d5ed10377512de9a56adca497
parentd2d12b0aee6dea7425bcd154d173d68869500547 (diff)
Fix ssh-agent user creation - check if UID 999 exists first
- Check if UID 999 exists before creating user - Look up username for UID 999 dynamically - Fixes 'unknown user argocd' error
-rw-r--r--f3s/argocd/values.yaml12
1 files changed, 8 insertions, 4 deletions
diff --git a/f3s/argocd/values.yaml b/f3s/argocd/values.yaml
index 75d3c91..e1416a9 100644
--- a/f3s/argocd/values.yaml
+++ b/f3s/argocd/values.yaml
@@ -82,10 +82,14 @@ repoServer:
- |
# Install openssh as root
apk add --no-cache openssh
- # Create argocd user if it doesn't exist
- adduser -D -u 999 argocd 2>/dev/null || true
- # Start ssh-agent as argocd user
- su argocd -s /bin/sh -c '
+ # Check if user 999 exists, if not create argocd user
+ if ! id 999 >/dev/null 2>&1; then
+ adduser -D -u 999 argocd
+ fi
+ # Get username for UID 999
+ USERNAME=$(getent passwd 999 | cut -d: -f1)
+ # Start ssh-agent as user 999
+ su $USERNAME -s /bin/sh -c '
eval $(ssh-agent -s -a /tmp/ssh-agent/socket)
ssh-add /tmp/ssh-key/sshPrivateKey
# Keep agent running