浏览代码

Allow overriding service account name

Waqar Ahmed 4 年之前
父节点
当前提交
68d7eace3b
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      library/common/2101.0.0/templates/lib/chart/_names.tpl

+ 5 - 1
library/common/2101.0.0/templates/lib/chart/_names.tpl

@@ -44,7 +44,11 @@ Create chart name and version as used by the chart label.
 Determine service account name for deployment or statefulset.
 */}}
 {{- define "common.names.serviceAccountName" -}}
-{{- (include "common.names.fullname" .) | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- if .Values.serviceAccountNameOverride }}
+{{- .Values.serviceAccountNameOverride | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- printf "%s-service-account" (include "common.names.releaseName" .) | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
 {{- end -}}