From 69cd00bbc1bb88b650d110494fef70b32375f86c Mon Sep 17 00:00:00 2001 From: sk-portkey Date: Mon, 29 Jun 2026 13:26:39 +0530 Subject: [PATCH] fix: set service account default creation to false --- charts/portkey-gateway/templates/_helpers.tpl | 8 ++++++-- charts/portkey-gateway/values.yaml | 7 ++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/charts/portkey-gateway/templates/_helpers.tpl b/charts/portkey-gateway/templates/_helpers.tpl index e471adc..e238b42 100644 --- a/charts/portkey-gateway/templates/_helpers.tpl +++ b/charts/portkey-gateway/templates/_helpers.tpl @@ -104,16 +104,20 @@ Create the name of the service account to use {{- 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 }} {{- end }} {{- 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 -}} {{- end -}} diff --git a/charts/portkey-gateway/values.yaml b/charts/portkey-gateway/values.yaml index f0389df..c886d44 100644 --- a/charts/portkey-gateway/values.yaml +++ b/charts/portkey-gateway/values.yaml @@ -155,13 +155,13 @@ environment: 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: "" podAnnotations: {} @@ -449,7 +449,8 @@ dataservice: loadBalancerSourceRanges: [] loadBalancerIP: "" 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: {} annotations: {}