Fix serviceAccountName not being set when create=false#64
Merged
Conversation
Two bugs were causing deployments to use the default service account when serviceAccount.create=false: 1. _helpers.tpl used .Values.service.name instead of .Values.serviceAccount.name 2. deployment.yaml only set serviceAccountName when create=true Now serviceAccountName is set whenever serviceAccount.name is provided, regardless of whether the chart creates the service account or uses an existing one.
🎉 Helm Chart Tests Passed!All modified charts have been successfully validated:
Summary:
📋 Detailed Information:
The PR is ready for review! 🚀 Note: Charts will be automatically released when this PR is merged to main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Deployments using
serviceAccount.create: falsewith an existing service account name were incorrectly using thedefaultservice account instead of the specified one.Root Cause
Two bugs in the common chart:
_helpers.tpl-common.serviceAccountNamehelper used.Values.service.nameinstead of.Values.serviceAccount.namedeployment.yaml- Only setserviceAccountNamewhenserviceAccount.createwas true:Fix
.Values.serviceAccount.nameserviceAccount.nameinstead ofserviceAccount.createNow
serviceAccountNameis set whenever a name is provided, regardless of whether the chart creates the SA or uses an existing one.Test Plan
serviceAccount.create: true→ SA created and usedserviceAccount.create: false, name: existing-sa→ existing SA used