Disable API token automount on spawned job pods #2

Merged
benvin merged 1 commits from benvin/job-no-automount into main 2026-08-30 16:05:38 +10:00
Member

Why

Job pods set ServiceAccountName but leave automount at its default, so every pr/watch/woodpecker-enable pod carries an unused k8s API token with the repospawner Role's access — no job subcommand touches the k8s API.

How

  • Set AutomountServiceAccountToken: false on the job PodSpec (the explicit vault-audience projected token volume is unchanged) and assert it in the job-spec test.
## Why Job pods set `ServiceAccountName` but leave automount at its default, so every pr/watch/woodpecker-enable pod carries an unused k8s API token with the repospawner Role's access — no job subcommand touches the k8s API. ## How - Set `AutomountServiceAccountToken: false` on the job PodSpec (the explicit vault-audience projected token volume is unchanged) and assert it in the job-spec test.
unkin-agent added 1 commit 2026-08-30 15:33:04 +10:00
Disable API token automount on spawned job pods
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
6aec05deae
Job pods only need the vault-audience projected token to log in; the
default automounted ServiceAccount token hands them the repospawner
Role's k8s API access that no job subcommand uses.
benvin merged commit 9b49170083 into main 2026-08-30 16:05:38 +10:00
benvin deleted branch benvin/job-no-automount 2026-08-30 16:05:38 +10:00
Sign in to join this conversation.