allow bypassing generate-st2client-config init container for st2client and jobs pods #261
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This allows users who pass credentials via extra_volumes or envFromSecrets to bypass the
generate-st2client-configinitContainer.This adds two boolean values:
st2client.generateST2ClientConfigandjobs.generateST2ClientConfig. By settinggenerateST2ClientConfigto false, users can exclude thegenerate-st2client-configinitContainer from st2client and/or jobs. Normally, that initContainer creates the/root/.st2/configfile. Users may want to skip that initContainer when they:/root/.st2/configfile viaextra_volumes; orST2_API_KEYorST2_AUTH_TOKENviaenvFromSecrets.Closes #233
Closes #256
Note: This PR is an alternate implementation of #256. (and I prefer this implementation over #256)
I want to provide the
ST2_API_KEYviaenvFromSecrets, but the/root/.st2/clientconfig with ausernametakes precedence over theST2_API_KEYenv var. When I looked into usingkustomizeI couldn't find a reliable way to remove the relevant initContainers.jsonPatchrelies on array indexes which would be very brittle, and merge stragety patches can't remove items from an array. So, this PR provides a simple flag to exclude the initContainers in question.