Skip to content

Commit

Permalink
Return back the common lables
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahsa committed Feb 21, 2024
1 parent 775ac71 commit e989095
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
12 changes: 12 additions & 0 deletions clients/harbor-client/charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "snappcloud-harbor-client.labels" -}}
helm.sh/chart: {{ include "snappcloud-harbor-client.chart" . }}
{{ include "snappcloud-harbor-client.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

Selector labels
*/}}
{{- define "snappcloud-harbor-client.selectorLabels" -}}
Expand Down
7 changes: 7 additions & 0 deletions clients/harbor-client/charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "snappcloud-harbor-client.fullname" . }}
labels:
{{- include "snappcloud-harbor-client.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
Expand All @@ -13,6 +15,11 @@ spec:
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "snappcloud-harbor-client.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
12 changes: 12 additions & 0 deletions clients/proxy-client/charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "snappcloud-proxy-client.labels" -}}
helm.sh/chart: {{ include "snappcloud-proxy-client.chart" . }}
{{ include "snappcloud-proxy-client.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

Selector labels
*/}}
{{- define "snappcloud-proxy-client.selectorLabels" -}}
Expand Down
7 changes: 7 additions & 0 deletions clients/proxy-client/charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "snappcloud-proxy-client.fullname" . }}
labels:
{{- include "snappcloud-proxy-client.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
Expand All @@ -13,6 +15,11 @@ spec:
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "snappcloud-proxy-client.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down

0 comments on commit e989095

Please sign in to comment.