Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make sure we remove any volumeMounts that were precreated when inject… #40

Merged
merged 3 commits into from
Jan 24, 2020

Conversation

byxorna
Copy link
Contributor

@byxorna byxorna commented Jan 24, 2020

…ing a serviceAccount

What and why?

I missed one edge case in #39 - any containers that exist in the admission requested pod before we inject a serviceAccount will already have had any VolumeMounts for the serviceaccount's token created, when automountServiceAccountToken:true. This is a bit annoying, and causes users of ServiceAccount injections to have original containers continue to use the default-token-* mount, whereas injected containers use the correct ${serviceAccountName}-token-* mount that is added by the ServiceAccountController after processing the MWAC injection.

Testing Steps

  • Added unit tests for this feature (make test)

Reviewers

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

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

@@ -230,27 +231,6 @@ func addContainers(target, added []corev1.Container, basePath string) (patch []p
return patch
}

func addInitContainers(target, added []corev1.Container, basePath string) (patch []patchOperation) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was no longer used, due to a previous refactor.

@byxorna byxorna merged commit 8fda7ff into master Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants