Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/github/home in K8s mode #181

Open
klaernie opened this issue Oct 8, 2024 · 0 comments
Open

/github/home in K8s mode #181

klaernie opened this issue Oct 8, 2024 · 0 comments

Comments

@klaernie
Copy link

klaernie commented Oct 8, 2024

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?

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

No branches or pull requests

1 participant