Переглянути джерело

Allow overriding service name

Waqar Ahmed 4 роки тому
батько
коміт
c325524327
1 змінених файлів з 3 додано та 0 видалено
  1. 3 0
      library/common/templates/classes/_service.tpl

+ 3 - 0
library/common/templates/classes/_service.tpl

@@ -5,6 +5,9 @@ within the common library.
 {{- define "common.classes.service" -}}
 {{- $values := .commonService -}}
 {{- $serviceName := include "common.names.fullname" . -}}
+{{- if hasKey $values "nameSuffix" -}}
+  {{- $serviceName = (printf "%v-%v" $serviceName $values.nameSuffix) -}}
+{{ end -}}
 {{- $svcType := $values.type | default "" -}}
 apiVersion: v1
 kind: Service