Skip to content

Commit

Permalink
Common labels (#8)
Browse files Browse the repository at this point in the history
* Change on charts,
Adding tpl files for both charts + edit deployments

* Delete common labels from helpers.tpl

---------

Co-authored-by: Mahsa <mahsa.soleimani@snapp.cab>
  • Loading branch information
divergentluna and Mahsa authored Feb 20, 2024
1 parent fe84519 commit eb69d08
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 48 deletions.
13 changes: 0 additions & 13 deletions clients/harbor-client/charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,6 @@ 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: 0 additions & 7 deletions clients/harbor-client/charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ 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 @@ -15,11 +13,6 @@ 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
2 changes: 0 additions & 2 deletions clients/harbor-client/charts/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.configSecretName }}
labels:
{{- include "snappcloud-harbor-client.labels" . | nindent 4 }}
type: Opaque
stringData:
IMAGE_REFERENCE: "The image reference URL starts with //."
2 changes: 0 additions & 2 deletions clients/harbor-client/charts/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ apiVersion: v1
kind: Service
metadata:
name: {{ include "snappcloud-harbor-client.fullname" . }}
labels:
{{- include "snappcloud-harbor-client.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand Down
13 changes: 0 additions & 13 deletions clients/proxy-client/charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,6 @@ 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: 0 additions & 7 deletions clients/proxy-client/charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ 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 @@ -15,11 +13,6 @@ 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
2 changes: 0 additions & 2 deletions clients/proxy-client/charts/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.configSecretName }}
labels:
{{- include "snappcloud-proxy-client.labels" . | nindent 4 }}
type: Opaque
stringData:
PROXY_URL: "The proxy address."
2 changes: 0 additions & 2 deletions clients/proxy-client/charts/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ apiVersion: v1
kind: Service
metadata:
name: {{ include "snappcloud-proxy-client.fullname" . }}
labels:
{{- include "snappcloud-proxy-client.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
Expand Down

0 comments on commit eb69d08

Please sign in to comment.