tumblr / k8s-sidecar-injector

Kubernetes sidecar injection service
Apache License 2.0
345 stars 75 forks source link

rejigger how initContainers are mutated to not forget VolumeMounts #41

Closed byxorna closed 4 years ago

byxorna commented 4 years ago

What and why?

A small refactor to catch a bug managing initContainers - we were not injecting VolumeMounts into existing InitContainers in the AdmissionControlRequest. I have added tests to validate this behavior now, and did some slight changes to make sure we are injecting env vars+volumeMounts into initContainers.

@komapa @alex-laties @defect

Testing Steps

Run unit tests

Reviewers

Required reviewers: @byxorna Request reviews from other people you want to review this PR in the "Reviewers" section on the right.

:warning: this PR must have at least 2 thumbs from the MAINTAINERS.md of the project before merging!

komapa commented 4 years ago
--- FAIL: TestGoodConfigs (0.00s)
366    config_test.go:227: expected 0 Envs loaded from test/fixtures/sidecars/maxmind.yaml but got 1
byxorna commented 4 years ago

@komapa @alex-laties another round, if you please? Travis is a bit flaky :)