-
Notifications
You must be signed in to change notification settings - Fork 62
Description
Describe the bug
Dynamic jobs created via an output to /infrabox/output/infrabox.json force future docker-image jobs to lose Git context by binding /infrabox/context to /data/repo/.infrabox/output
To Reproduce
- Create a dynamic job by copying an infrabox.json file to /infrabox/output/infrabox.json with a
docker-imagetype job. - Git repo is cloned like normal
- Git context is inaccessible because docker mounts are as follows:
"Mounts": [
{
"Type": "bind",
"Source": "/data/repo/.infrabox",
"Destination": "/infrabox",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/data/repo/.infrabox/output",
"Destination": "/infrabox/context",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}
],
Expected behavior
Normal docker-image jobs would have context set to the git repo (/data/repo). Context is empty unless other files are copied to /infrabox/output
I am assuming this is unintended behavior. At the least it seems undocumented behavior. Context is set in job.py to the Infrabox output folder in https://github.com/SAP/InfraBox/blob/master/src/job/job.py#L445-L454.
Our use case was to write a tool that would run workflows (specific infrabox.json files) on specific branches. If the branch matched, the file was copied to /infrabox/output/infrabox.json (ie: master or release branch workflows). Unfortunately the workflows subsequently failed because the git repo was inaccessible to the dynamically created jobs.
Clarifying that this issue primarily affects docker-image jobs since in docker jobs the build_context can be changed (to ../.. in most examples I've seen) which I don't believe is possible with docker-image