buildkite / buildkite/agent-stack-k8s
Can't use non-root user with podSpecPatch
- Dominant language
- Go
- Stars
- 110
- Forks
- 57
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 5
Description
Hi, I'm trying to use the new functionality introduced with https://github.com/buildkite/agent-stack-k8s/pull/282 but running into some issues with checkout. I was initially seeing the checkout container error at startup with this message logged:
```
mkdir: can't create directory '//.ssh': Permission denied
```
I compared the resulting pod spec from before and after and noticed that previously [this logic](https://github.com/buildkite/agent-stack-k8s/blob/main/internal/controller/scheduler/scheduler.go#L582) seems to have been triggered to create a non-root user and it looks like that's no longer happening when using podSpecPatch.
I tried manually adding the root `securityContext` in my podSpecPatch but that causes other permissions errors after checkout, since it's trying to run as a non-root user later. It seems like the above linked logic needs to be triggered even when using podSpecPatch?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.