22{ {/*
33Expand the name of the chart.
44*/} }
5- { {- define " csi.name" -} }
5+ { {- define " cloudstack- csi-driver .name" -} }
66{ {- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix " -" -} }
77{ {- end -} }
88
@@ -11,7 +11,7 @@ Create a default fully qualified app name.
1111We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
1212If release name contains chart name it will be used as a full name.
1313*/} }
14- { {- define " csi.fullname" -} }
14+ { {- define " cloudstack- csi-driver .fullname" -} }
1515{ {- if .Values.fullnameOverride -} }
1616{ {- .Values.fullnameOverride | trunc 63 | trimSuffix " -" -} }
1717{ {- else -} }
@@ -27,73 +27,36 @@ If release name contains chart name it will be used as a full name.
2727{ {/*
2828Create chart name and version as used by the chart label.
2929*/} }
30- { {- define " csi.chart" -} }
30+ { {- define " cloudstack- csi-driver .chart" -} }
3131{ {- printf " %s-%s" .Chart.Name .Chart.Version | replace " +" " _" | trunc 63 | trimSuffix " -" -} }
3232{ {- end -} }
3333
3434{ {/*
3535Common labels
3636*/} }
37- { {- define " csi.labels" -} }
38- app.kubernetes.io/name: { { include " csi.name" . } }
39- helm.sh/chart: { { include " csi.chart" . } }
40- app.kubernetes.io/instance: { { .Release.Name } }
37+ { {- define " cloudstack-csi-driver.labels" -} }
38+ { { include " cloudstack-csi-driver.selectorLabels" . } }
39+ helm.sh/chart: { { include " cloudstack-csi-driver.chart" . } }
4140{ {- if .Chart.AppVersion } }
4241app.kubernetes.io/version: { { .Chart.AppVersion | quote } }
4342{ {- end } }
43+ app.kubernetes.io/component: csi-driver
4444app.kubernetes.io/managed-by: { { .Release.Service } }
45- { {- end -} }
46-
47-
48- { {/*
49- Create the name of the service account to use
50- */} }
51- { {- define " csi.serviceAccountName" -} }
52- { {- if .Values.serviceAccount.create -} }
53- { { default (include " csi.fullname" .) .Values.serviceAccount.name } }
54- { {- else -} }
55- { { default " default" .Values.serviceAccount.name } }
56- { {- end -} }
45+ { {- if .Values.customLabels } }
46+ { { toYaml .Values.extraLabels } }
47+ { {- end } }
5748{ {- end -} }
5849
5950{ {/*
60- Create unified labels for csi components
51+ Common selector labels
6152*/} }
62- { {- define " csi.common.matchLabels" -} }
63- app: { { template " csi.name" . } }
64- release: { { .Release.Name } }
65- { {- end -} }
66-
67- { {- define " csi.common.metaLabels" -} }
68- chart: { { template " csi.chart" . } }
69- heritage: { { .Release.Service } }
70- { {- if .Values.extraLabels } }
71- { { toYaml .Values.extraLabels -} }
72- { {- end } }
73- { {- end -} }
74-
75- { {- define " csi.controller.matchLabels" -} }
76- component: controller
77- { { include " csi.common.matchLabels" . } }
78- { {- end -} }
79-
80- { {- define " csi.controller.labels" -} }
81- { { include " csi.controller.matchLabels" . } }
82- { { include " csi.common.metaLabels" . } }
83- { {- end -} }
84-
85- { {- define " csi.node.matchLabels" -} }
86- component: node
87- { { include " csi.common.matchLabels" . } }
88- { {- end -} }
89-
90- { {- define " csi.node.labels" -} }
91- { { include " csi.node.matchLabels" . } }
92- { { include " csi.common.metaLabels" . } }
53+ { {- define " cloudstack-csi-driver.selectorLabels" -} }
54+ app.kubernetes.io/name: { { include " cloudstack-csi-driver.name" . } }
55+ app.kubernetes.io/instance: { { .Release.Name } }
9356{ {- end -} }
9457
9558{ {/*
96- Create cloud-config makro .
59+ Create cloud-config macro .
9760*/} }
9861{ {- define " cloudConfig" -} }
9962[Global]
0 commit comments