Skip to content

Commit

Permalink
fix: make broker servicename k8s api compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
saumilmac committed Jul 25, 2024
1 parent 99aa6f9 commit 1bee012
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions charts/snyk-broker/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,12 @@ Create the name of the broker service to use
*/}}
{{- define "snyk-broker.brokerServiceName" -}}
{{- if not .Values.disableSuffixes -}}
{{- .Values.scmType }}-broker-service-{{ .Release.Name }}
{{- $suffixLength := 16 -}}
{{- $releaseNameLength := len .Release.Name -}}
{{- $truncatedLength := int (sub 63 (add $suffixLength $releaseNameLength)) -}}
{{- .Values.scmType | trunc $truncatedLength }}-broker-service-{{ .Release.Name }}
{{- else }}
{{- .Values.scmType}}-broker-service
{{- .Values.scmType | trunc 47 }}-broker-service
{{- end -}}
{{- end -}}

Expand Down

0 comments on commit 1bee012

Please sign in to comment.