Skip to content

Commit

Permalink
Merge pull request #843 from dduportal/fix/plugin-site-frontend/pdb-s…
Browse files Browse the repository at this point in the history
…electors

fix(plugin-site) correct labels of the frontend deployment
  • Loading branch information
dduportal authored Oct 6, 2023
2 parents a10f3fa + 8a63f60 commit c2dc2cb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/plugin-site/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ maintainers:
- name: timja
- name: halkeye
name: plugin-site
version: 0.3.0
version: 0.3.1
13 changes: 13 additions & 0 deletions charts/plugin-site/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ app.kubernetes.io/name: {{ include "plugin-site.name" . }}-frontend
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Common labels frontend
*/}}
{{- define "plugin-site-frontend.labels" -}}
{{ include "plugin-site-frontend.selectorLabels" . }}
helm.sh/chart: {{ include "plugin-site.chart" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
jenkins.io/maintainer: {{ (index .Chart.Maintainers 0).Name }}
{{- end -}}

{{/*
Selector labels
*/}}
Expand Down
6 changes: 3 additions & 3 deletions charts/plugin-site/templates/deployment-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "plugin-site.fullname" . }}-frontend
labels: {{ include "plugin-site.labels" . | nindent 4 }}
labels: {{ include "plugin-site-frontend.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.frontend.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "plugin-site.name" . }}
app.kubernetes.io/name: {{ include "plugin-site.name" . }}-frontend
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels: {{ include "plugin-site.labels" . | nindent 8 }}
labels: {{ include "plugin-site-frontend.labels" . | nindent 8 }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/nginx-configmap.yaml") . | sha256sum }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/plugin-site/tests/defaults_values_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tests:
value: IfNotPresent
- equal:
path: metadata.labels["app.kubernetes.io/name"]
value: plugin-site
value: plugin-site-frontend
- equal:
path: metadata.labels["app.kubernetes.io/managed-by"]
value: Helm
Expand Down

0 comments on commit c2dc2cb

Please sign in to comment.