Skip to content

Commit 2c45ff1

Browse files
committed
fix component label selector not works
1 parent 18b9dd4 commit 2c45ff1

6 files changed

Lines changed: 15 additions & 1 deletion

File tree

charts/cmdb/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.8
18+
version: 0.1.9
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/cmdb/templates/_helpers.tpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,11 @@ Create the name of the service account to use
6868
{{- default "default" .Values.api.serviceAccount.name }}
6969
{{- end }}
7070
{{- end }}
71+
72+
{{- define "cmdb.api.component" -}}
73+
component: cmdb-api
74+
{{- end }}
75+
76+
{{- define "cmdb.ui.component" -}}
77+
component: cmdb-ui
78+
{{- end }}

charts/cmdb/templates/api/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ spec:
1111
selector:
1212
matchLabels:
1313
{{- include "cmdb.labels" . | nindent 6 }}
14+
{{- include "cmdb.api.component" . | nindent 6 }}
1415
template:
1516
metadata:
1617
{{- with .Values.api.podAnnotations }}
@@ -19,6 +20,7 @@ spec:
1920
{{- end }}
2021
labels:
2122
{{- include "cmdb.labels" . | nindent 8 }}
23+
{{- include "cmdb.api.component" . | nindent 8 }}
2224
{{- with .Values.api.podLabels }}
2325
{{- toYaml . | nindent 8 }}
2426
{{- end }}

charts/cmdb/templates/api/service.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ spec:
1313
name: http
1414
selector:
1515
{{- include "cmdb.selectorLabels" . | nindent 4 }}
16+
{{- include "cmdb.api.component" . | nindent 4 }}

charts/cmdb/templates/ui/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ spec:
1111
selector:
1212
matchLabels:
1313
{{- include "cmdb.labels" . | nindent 6 }}
14+
{{- include "cmdb.ui.component" . | nindent 6 }}
1415
template:
1516
metadata:
1617
{{- with .Values.ui.podAnnotations }}
@@ -19,6 +20,7 @@ spec:
1920
{{- end }}
2021
labels:
2122
{{- include "cmdb.labels" . | nindent 8 }}
23+
{{- include "cmdb.ui.component" . | nindent 8 }}
2224
{{- with .Values.ui.podLabels }}
2325
{{- toYaml . | nindent 8 }}
2426
{{- end }}

charts/cmdb/templates/ui/service.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ spec:
1313
name: http
1414
selector:
1515
{{- include "cmdb.selectorLabels" . | nindent 4 }}
16+
{{- include "cmdb.ui.component" . | nindent 4 }}

0 commit comments

Comments
 (0)