Skip to content

Commit 3af9543

Browse files
committed
k8s: create workspace group-writable in fs-init (umask 002)
fs-init runs as uid 1001 and mkdir's the work/externals/github dirs at the default 0755. The pod securityContext uses fsGroup: 1001, so every job container process is in group 1001 — but 0755 grants the group only r-x, so a job image running as a non-root uid other than 1001 can't write the workspace and checkout fails with '.git: Permission denied'. Set umask 002 in fs-init so those dirs are created 0775 (group-writable), letting any job user write the workspace via the fsGroup.
1 parent cf62bcc commit 3af9543

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

packages/k8s/src/k8s/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ export async function createJobPod(
106106
const workingDirPath = githubWorkspace?.split('/').slice(-2).join('/') ?? ''
107107

108108
const initCommands = [
109+
// group-writable dirs so non-1001 job images can write the workspace (fsGroup)
110+
'umask 002',
109111
'mkdir -p /mnt/externals',
110112
'mkdir -p /mnt/work',
111113
'mkdir -p /mnt/github',

0 commit comments

Comments
 (0)