fix: set service account default creation to false#217
Open
sk-portkey wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR changes the Helm chart defaults so the chart no longer creates ServiceAccounts by default, and adjusts helper templates to compute the ServiceAccount name for gateway and dataservice.
Changes:
- Set
serviceAccount.createdefault tofalsefor both gateway and dataservice invalues.yaml. - Updated
templates/_helpers.tplto enforce a non-empty ServiceAccount name whencreateisfalse(currently viafail). - Updated inline comments in
values.yamlaround ServiceAccount naming requirements.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| charts/portkey-gateway/values.yaml | Changes ServiceAccount creation defaults and updates comments for naming behavior. |
| charts/portkey-gateway/templates/_helpers.tpl | Updates helper functions that determine which ServiceAccount name is used by workloads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
104
to
111
| {{- define "portkeyenterprise.serviceAccountName" -}} | ||
| {{- if .Values.serviceAccount.create }} | ||
| {{- default (include "portkeyenterprise.fullname" .) .Values.serviceAccount.name }} | ||
| {{- else if not .Values.serviceAccount.name }} | ||
| {{- fail "serviceAccount.name must be set when serviceAccount.create is false" }} | ||
| {{- else }} | ||
| {{- default "default" .Values.serviceAccount.name }} | ||
| {{- .Values.serviceAccount.name }} | ||
| {{- end }} |
Comment on lines
114
to
121
| {{- define "dataservice.serviceAccountName" -}} | ||
| {{- if .Values.dataservice.serviceAccount.create -}} | ||
| {{ default (printf "%s-%s" (include "portkeyenterprise.fullname" .) .Values.dataservice.name) .Values.dataservice.serviceAccount.name | trunc 63 | trimSuffix "-" }} | ||
| {{- else if not .Values.dataservice.serviceAccount.name -}} | ||
| {{- fail "dataservice.serviceAccount.name must be set when dataservice.serviceAccount.create is false" }} | ||
| {{- else -}} | ||
| {{ default "default" .Values.dataservice.serviceAccount.name }} | ||
| {{ .Values.dataservice.serviceAccount.name | trunc 63 | trimSuffix "-" }} | ||
| {{- end -}} |
Comment on lines
156
to
165
| serviceAccount: | ||
| # Specifies whether a service account should be created | ||
| create: true | ||
| create: false | ||
| # Automatically mount a ServiceAccount's API credentials? | ||
| automount: true | ||
| # Annotations to add to the service account | ||
| annotations: {} | ||
| # The name of the service account to use. | ||
| # If not set and create is true, a name is generated using the fullname template | ||
| # Required when create is false. If not set and create is true, a name is generated using the fullname template | ||
| name: "" |
Comment on lines
451
to
455
| serviceAccount: | ||
| create: true | ||
| create: false | ||
| # Required when create is false. If not set and create is true, a name is generated using the fullname template | ||
| name: "" | ||
| labels: {} |
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.
No description provided.