fix(k8s): always copy GitHub workspace directories regardless of userMountVolumes #300
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
The prepare script that copies GitHub workspace directories (/_github_workflow, /_github_home) from /__w/_temp/ to /github/ was only created and executed when userMountVolumes were defined. This caused failures when actions tried to access $GITHUB_EVENT_PATH=/github/workflow/event.json in environments without user mounts.
Root Cause:
The conditional logic at line 102 tied the creation of the prepare script to the presence of userMountVolumes:
However, the prepare script ALWAYS needs to run to copy GitHub directories - these are required for GitHub Actions to function correctly. The user mounts are optional.
Impact:
This bug affected:
Solution:
Testing:
This fix has been validated in production with deskrun's cached-privileged-kubernetes runners, where actions like Docker Buildx can now successfully access event.json.
Fixes #299
Related: rkoster/deskrun#28