If I understand
|
export function containerVolumes( |
|
userMountVolumes: Mount[] = [], |
|
jobContainer = true, |
|
containerAction = false |
|
): k8s.V1VolumeMount[] { |
|
const mounts: k8s.V1VolumeMount[] = [ |
|
{ |
|
name: POD_VOLUME_NAME, |
|
mountPath: '/__w' |
|
} |
|
] |
|
|
|
const workspacePath = process.env.GITHUB_WORKSPACE as string |
|
if (containerAction) { |
|
const i = workspacePath.lastIndexOf('_work/') |
|
const workspaceRelativePath = workspacePath.slice(i + '_work/'.length) |
|
mounts.push( |
|
{ |
|
name: POD_VOLUME_NAME, |
|
mountPath: '/github/workspace', |
|
subPath: workspaceRelativePath |
|
}, |
|
{ |
|
name: POD_VOLUME_NAME, |
|
mountPath: '/github/file_commands', |
|
subPath: '_temp/_runner_file_commands' |
|
}, |
|
{ |
|
name: POD_VOLUME_NAME, |
|
mountPath: '/github/workflow', |
|
subPath: '_temp/_github_workflow' |
|
} |
|
) |
|
return mounts |
|
} |
|
|
|
if (!jobContainer) { |
|
return mounts |
|
} |
|
|
|
mounts.push( |
|
{ |
|
name: POD_VOLUME_NAME, |
|
mountPath: '/__e', |
|
subPath: 'externals' |
|
}, |
|
{ |
|
name: POD_VOLUME_NAME, |
|
mountPath: '/github/home', |
|
subPath: '_temp/_github_home' |
|
}, |
correctly
/github/home does not get added to pods executing a docker container.
Some images however (like super-linter) expect /github/home to be existent and writable. In my specific case I found out, that when running super-linter in a k8s-mode selfhosted runner it fails to execute, since it tries to modify the user's .gitconfig (to mark /github/workspace a git safe directory), which fails since the entire homedir does not exist. I've opened super-linter/super-linter#6242 do fix this issue for super-linter, but I would expect that there are more actions out in the wild that will fail in a similar fashion.
Is there any specific reason why this volume mount is excluded?
If I understand
runner-container-hooks/packages/k8s/src/k8s/utils.ts
Lines 18 to 68 in 73655d4
/github/homedoes not get added to pods executing a docker container.Some images however (like super-linter) expect
/github/hometo be existent and writable. In my specific case I found out, that when running super-linter in a k8s-mode selfhosted runner it fails to execute, since it tries to modify the user's.gitconfig(to mark/github/workspacea git safe directory), which fails since the entire homedir does not exist. I've opened super-linter/super-linter#6242 do fix this issue for super-linter, but I would expect that there are more actions out in the wild that will fail in a similar fashion.Is there any specific reason why this volume mount is excluded?