Skip to content

Commit

Permalink
Update _helpers.tpl
Browse files Browse the repository at this point in the history
  • Loading branch information
tripathishikha1 authored Jun 19, 2024
1 parent 401930d commit a57b947
Showing 1 changed file with 49 additions and 11 deletions.
60 changes: 49 additions & 11 deletions charts/microservice/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,19 +1,57 @@
#{{- define "microservice.fullname" -}}
#{{- printf "%s-%s" (default .Chart.Name .Values.env.microservice.fullname) .Release.Name | trunc 63 | trimSuffix "-" }}
#{{- end -}}

#{{- define "microservice.labels" -}}
#app.kubernetes.io/name: {{ .Chart.Name | quote }}
#helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | replace ":" "-" | quote }}
#app.kubernetes.io/instance: {{ .Release.Name | quote }}
#app.kubernetes.io/version: {{ .Chart.AppVersion | replace "+" "_" | replace ":" "-" | quote }}
#app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
#{{- end -}}

#{{- define "microservice.selectorLabels" -}}
#app: {{ default .Values.env.microservice.selectorLabels .Chart.Name | quote }}
#{{- end -}}

#{{- define "microservice.matchLabels" -}}
#app: {{ default .Values.env.microservice.selectorLabels .Chart.Name | quote }}
#{{- end -}}

{{/* Define the "microservice.fullname" template */}}
{{- define "microservice.fullname" -}}
{{- printf "%s-%s" (default .Chart.Name .Values.env.microservice.fullname) .Release.Name | trunc 63 | trimSuffix "-" }}
{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "microservice.labels" -}}
app.kubernetes.io/name: {{ .Chart.Name | quote }}
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | replace ":" "-" | quote }}
app.kubernetes.io/instance: {{ .Release.Name | quote }}
app.kubernetes.io/version: {{ .Chart.AppVersion | replace "+" "_" | replace ":" "-" | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
{{/* Define the "microservice.name" template (if needed) */}}
{{- define "microservice.name" -}}
{{- .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "microservice.selectorLabels" -}}
app: {{ default .Values.env.microservice.selectorLabels .Chart.Name | quote }}
{{/* Define the "microservice.chart" template (if needed) */}}
{{- define "microservice.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/* Define other templates as necessary */}}
{{/* Define the "microservice.labels" template */}}
{{- define "microservice.labels" -}}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

{{/* Define the "microservice.matchLabels" template */}}
{{- define "microservice.matchLabels" -}}
app: {{ default .Values.env.microservice.selectorLabels .Chart.Name | quote }}
{{- end -}}
{{- with .Values.app.name }}
app: {{ . }}
{{- end }}
{{- end }}

{{/* Define the "microservice.selectorLabels" template */}}
{{- define "microservice.selectorLabels" -}}
{{- with .Values.app.name }}
app: {{ . }}
{{- end }}
{{- end }}

0 comments on commit a57b947

Please sign in to comment.