buildkite / buildkite/agent-stack-k8s
[FEATURE] Allow setting container command / args in Controller pod-spec-patch Config
- Dominant language
- Go
- Stars
- 110
- Forks
- 57
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 5
Description
## Description
Currently if any container command / args are provided in the Controller's `config.pod-spec-patch`, including for "non-reserved" sidecar containers, the Controller does not the config and fails on startup (from [this logic](https://github.com/buildkite/agent-stack-k8s/blob/50f69571fa0b0501a2c665e77f25b0f3f86b666f/cmd/controller/controller.go#L294-L302) in `ParseAndValidateConfig`):
```
Error: failed to parse config: modifying container commands or args via podSpecPatch is not supported
```
This conflicts with functionality described in [override_commands.md](https://github.com/buildkite/agent-stack-k8s/blob/main/docs/override_commands.md), and supporting logic in [Scheduler.PatchPodSpec](https://github.com/buildkite/agent-stack-k8s/blob/50f69571fa0b0501a2c665e77f25b0f3f86b666f/internal/controller/scheduler/scheduler.go#L877-L997), which allows for providing the `command` and `args` in the `podSpecPatch` via the `kubernetes` Plugin config in a given `pipeline.yml`, even overriding the defaults for the "reserved" containers (provided another flag is set).
## Describe the solution you'd like
Ideally the logic/functionality in both places would be the same. We'd like to be able to provide specific container command/args to certain additional Sidecar containers for a given Controller — for instance we have a single Sidecar Image supporting different commands to run depending on the Agent "pool".
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.