tumblr / k8s-sidecar-injector

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

Correctly handle inheritance with ServiceAccounts #39

Closed byxorna closed 4 years ago

byxorna commented 4 years ago

What and why?

I found a but that would cause an injection config that uses inheritance to not correctly inherit the ServiceAccountName. Additionally, I accidentally would skip injecting the serviceAccount if the pod admission request was not empty, but this is bad because the default ServiceAccountName is called "default".

Testing Steps

Reviewers

Required reviewers: @byxorna @defect @komapa @tumblr/k8s 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!