Skip to content

Commit 279e27b

Browse files
committed
fix(csi-cinder-plugin): apply commonAnnotation to all resources
needed if we want to be consistent with commonAnnotations defined in the occm chart
1 parent 044cc93 commit 279e27b

File tree

6 files changed

+67
-5
lines changed

6 files changed

+67
-5
lines changed

charts/cinder-csi-plugin/templates/cinder-csi-driver.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ apiVersion: storage.k8s.io/v1
22
kind: CSIDriver
33
metadata:
44
name: cinder.csi.openstack.org
5+
annotations:
6+
{{- with .Values.commonAnnotations }}
7+
{{- toYaml . | nindent 4 }}
8+
{{- end }}
59
spec:
610
attachRequired: true
711
podInfoOnMount: true

charts/cinder-csi-plugin/templates/controllerplugin-rbac.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@ kind: ServiceAccount
66
metadata:
77
name: csi-cinder-controller-sa
88
namespace: {{ .Release.Namespace }}
9+
annotations:
10+
{{- with .Values.commonAnnotations }}
11+
{{- toYaml . | nindent 4 }}
12+
{{- end }}
913
---
1014
kind: ClusterRole
1115
apiVersion: rbac.authorization.k8s.io/v1
1216
metadata:
1317
name: csi-attacher-role
18+
annotations:
19+
{{- with .Values.commonAnnotations }}
20+
{{- toYaml . | nindent 4 }}
21+
{{- end }}
1422
rules:
1523
- apiGroups: [""]
1624
resources: ["persistentvolumes"]
@@ -32,6 +40,10 @@ kind: ClusterRoleBinding
3240
apiVersion: rbac.authorization.k8s.io/v1
3341
metadata:
3442
name: csi-attacher-binding
43+
annotations:
44+
{{- with .Values.commonAnnotations }}
45+
{{- toYaml . | nindent 4 }}
46+
{{- end }}
3547
subjects:
3648
- kind: ServiceAccount
3749
name: csi-cinder-controller-sa
@@ -46,6 +58,10 @@ kind: ClusterRole
4658
apiVersion: rbac.authorization.k8s.io/v1
4759
metadata:
4860
name: csi-provisioner-role
61+
annotations:
62+
{{- with .Values.commonAnnotations }}
63+
{{- toYaml . | nindent 4 }}
64+
{{- end }}
4965
rules:
5066
- apiGroups: [""]
5167
resources: ["persistentvolumes"]
@@ -79,6 +95,10 @@ kind: ClusterRoleBinding
7995
apiVersion: rbac.authorization.k8s.io/v1
8096
metadata:
8197
name: csi-provisioner-binding
98+
annotations:
99+
{{- with .Values.commonAnnotations }}
100+
{{- toYaml . | nindent 4 }}
101+
{{- end }}
82102
subjects:
83103
- kind: ServiceAccount
84104
name: csi-cinder-controller-sa
@@ -93,6 +113,10 @@ kind: ClusterRole
93113
apiVersion: rbac.authorization.k8s.io/v1
94114
metadata:
95115
name: csi-snapshotter-role
116+
annotations:
117+
{{- with .Values.commonAnnotations }}
118+
{{- toYaml . | nindent 4 }}
119+
{{- end }}
96120
rules:
97121
- apiGroups: [""]
98122
resources: ["events"]
@@ -121,6 +145,10 @@ kind: ClusterRoleBinding
121145
apiVersion: rbac.authorization.k8s.io/v1
122146
metadata:
123147
name: csi-snapshotter-binding
148+
annotations:
149+
{{- with .Values.commonAnnotations }}
150+
{{- toYaml . | nindent 4 }}
151+
{{- end }}
124152
subjects:
125153
- kind: ServiceAccount
126154
name: csi-cinder-controller-sa
@@ -134,6 +162,10 @@ kind: ClusterRole
134162
apiVersion: rbac.authorization.k8s.io/v1
135163
metadata:
136164
name: csi-resizer-role
165+
annotations:
166+
{{- with .Values.commonAnnotations }}
167+
{{- toYaml . | nindent 4 }}
168+
{{- end }}
137169
rules:
138170
# The following rule should be uncommented for plugins that require secrets
139171
# for provisioning.
@@ -163,6 +195,10 @@ kind: ClusterRoleBinding
163195
apiVersion: rbac.authorization.k8s.io/v1
164196
metadata:
165197
name: csi-resizer-binding
198+
annotations:
199+
{{- with .Values.commonAnnotations }}
200+
{{- toYaml . | nindent 4 }}
201+
{{- end }}
166202
subjects:
167203
- kind: ServiceAccount
168204
name: csi-cinder-controller-sa

charts/cinder-csi-plugin/templates/nodeplugin-rbac.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@ kind: ServiceAccount
33
metadata:
44
name: csi-cinder-node-sa
55
namespace: {{ .Release.Namespace }}
6+
annotations:
7+
{{- with .Values.commonAnnotations }}
8+
{{- toYaml . | nindent 4 }}
9+
{{- end }}
610
---
711
kind: ClusterRole
812
apiVersion: rbac.authorization.k8s.io/v1
913
metadata:
1014
name: csi-nodeplugin-role
15+
annotations:
16+
{{- with .Values.commonAnnotations }}
17+
{{- toYaml . | nindent 4 }}
18+
{{- end }}
1119
rules:
1220
- apiGroups: [""]
1321
resources: ["events"]
@@ -18,6 +26,10 @@ kind: ClusterRoleBinding
1826
apiVersion: rbac.authorization.k8s.io/v1
1927
metadata:
2028
name: csi-nodeplugin-binding
29+
annotations:
30+
{{- with .Values.commonAnnotations }}
31+
{{- toYaml . | nindent 4 }}
32+
{{- end }}
2133
subjects:
2234
- kind: ServiceAccount
2335
name: csi-cinder-node-sa

charts/cinder-csi-plugin/templates/secret.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ kind: Secret
44
metadata:
55
name: {{ .Values.secret.name }}
66
namespace: {{ .Release.Namespace }}
7+
annotations:
8+
{{- with .Values.commonAnnotations }}
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
711
type: Opaque
812
stringData:
913
{{ .Values.secret.data | toYaml | trimSuffix "\n" | nindent 2 }}

charts/cinder-csi-plugin/templates/storageclass.yaml

+10-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ apiVersion: storage.k8s.io/v1
33
kind: StorageClass
44
metadata:
55
name: csi-cinder-sc-delete
6-
{{- if .Values.storageClass.delete.isDefault }}
76
annotations:
7+
{{- with .Values.commonAnnotations }}
8+
{{- toYaml . | nindent 4 }}
9+
{{- end }}
10+
{{- if .Values.storageClass.delete.isDefault }}
811
storageclass.kubernetes.io/is-default-class: "true"
9-
{{- end }}
12+
{{- end }}
1013
provisioner: cinder.csi.openstack.org
1114
reclaimPolicy: Delete
1215
allowVolumeExpansion: {{ .Values.storageClass.delete.allowVolumeExpansion }}
@@ -15,10 +18,13 @@ apiVersion: storage.k8s.io/v1
1518
kind: StorageClass
1619
metadata:
1720
name: csi-cinder-sc-retain
18-
{{- if .Values.storageClass.retain.isDefault }}
1921
annotations:
22+
{{- with .Values.commonAnnotations }}
23+
{{- toYaml . | nindent 4 }}
24+
{{- end }}
25+
{{- if .Values.storageClass.retain.isDefault }}
2026
storageclass.kubernetes.io/is-default-class: "true"
21-
{{- end }}
27+
{{- end }}
2228
provisioner: cinder.csi.openstack.org
2329
reclaimPolicy: Retain
2430
allowVolumeExpansion: {{ .Values.storageClass.retain.allowVolumeExpansion }}

charts/cinder-csi-plugin/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,5 +204,5 @@ priorityClassName: ""
204204
imagePullSecrets: []
205205
# - name: my-imagepull-secret
206206

207-
# add annotations to all pods
207+
## Annotations to apply to all resources
208208
commonAnnotations: {}

0 commit comments

Comments
 (0)