Skip to content

fix(gh-cli): use numeric USER 1000 so kubelet runAsNonRoot validates#5

Merged
xnoto merged 2 commits intomainfrom
ci/split-build-and-deploy
Apr 30, 2026
Merged

fix(gh-cli): use numeric USER 1000 so kubelet runAsNonRoot validates#5
xnoto merged 2 commits intomainfrom
ci/split-build-and-deploy

Conversation

@xnoto
Copy link
Copy Markdown
Contributor

@xnoto xnoto commented Apr 30, 2026

Summary

Pods running this image with securityContext.runAsNonRoot: true fail to start: container has runAsNonRoot and image has non-numeric user (gh), cannot verify user is non-root. Kubelet can only validate non-root from a numeric UID in the image config.

The gh user is already created with UID 1000 in the same RUN; just switch the USER directive to 1000.

Pairs with

  • kustomize-cluster PR — bootstrap/ci-token-sync-job.yaml Job uses this image and sets runAsNonRoot: true.

Test plan

  • Image still runs as the gh user (UID 1000, same shell, same WORKDIR /home/gh)
  • After merge + image rebuild: ci-token-sync Job in argocd ns runs to completion

🤖 Generated with Claude Code

xnoto added 2 commits April 29, 2026 15:46
Loosens the Push to registry gate so manual workflow_dispatch
runs publish to ghcr in addition to push-to-main events. Pull
request runs continue to skip the step (validation only).

Lets the user kick off a fresh build+push of one or all images
from the Actions pane "Run workflow" button without needing a
no-op commit on main to trigger via paths.
…sses

USER gh resolves to a name in image config; kubelet can't validate non-root
without a numeric UID, so consumers either had to set runAsUser explicitly
or skip runAsNonRoot. Use the existing UID (1000) directly.
@xnoto xnoto merged commit 4584b75 into main Apr 30, 2026
2 checks passed
@xnoto xnoto deleted the ci/split-build-and-deploy branch April 30, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant