aws-secret-sidecar-injector
aws-secret-sidecar-injector copied to clipboard
fix admission controller's podsInitContainerPatch
Admission Controller can't succesfully patch the pods spec in case you deploy deployments sequence with mixed initContainers definition: some of them has initContainers, some not. In this case admission controller successfully apply patch to pods without initContainer and then never apply patch to pods with initContainers defined.
It produce next error in ReplicaSet:
Warning FailedCreate 13m (x19 over 24m) replicaset-controller Error creating: Internal error occurred: invalid character '}' after array element
This MR avoid overriding global variable podsInitPatch
after first patch applying
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
@amit0701 didn't you already update the code to inject secrets into init containers? From what I recall, you iterate through and patch all of the init containers if the length of the array/slice is not 0. Can you have a look at this PR?
@jicowan Yes, there was a patch to start secret injector as a first initContainer: https://github.com/aws-samples/aws-secret-sidecar-injector/pull/51 But my MR fixes advanced issue, when you have multiply Deployments with initContainers and without ones.