Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

fix admission controller's podsInitContainerPatch #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gueux
Copy link

@gueux gueux commented Jul 7, 2021

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.

@jicowan
Copy link
Contributor

jicowan commented Jul 19, 2021

@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?

@gueux
Copy link
Author

gueux commented Sep 28, 2021

@jicowan Yes, there was a patch to start secret injector as a first initContainer: #51
But my MR fixes advanced issue, when you have multiply Deployments with initContainers and without ones.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants