@@ -15,8 +15,12 @@ func (c *IBMObjectCSI) GenerateCSIDriver() *storagev1.CSIDriver {
15
15
defaultFSGroupPolicy := storagev1 .FileFSGroupPolicy
16
16
return & storagev1.CSIDriver {
17
17
ObjectMeta : metav1.ObjectMeta {
18
- Name : config .DriverName ,
19
- Labels : map [string ]string {"app.kubernetes.io/name" : "ibm-object-csi" },
18
+ Name : config .DriverName ,
19
+ Labels : map [string ]string {
20
+ "app.kubernetes.io/name" : "ibm-object-csi" ,
21
+ "app.kubernetes.io/part-of" : config .Name ,
22
+ "app.kubernetes.io/managed-by" : "addon" ,
23
+ },
20
24
},
21
25
Spec : storagev1.CSIDriverSpec {
22
26
AttachRequired : boolptr .False (),
@@ -53,6 +57,10 @@ func (c *IBMObjectCSI) GenerateExternalProvisionerClusterRole() *rbacv1.ClusterR
53
57
return & rbacv1.ClusterRole {
54
58
ObjectMeta : metav1.ObjectMeta {
55
59
Name : config .GetNameForResource (config .ExternalProvisionerClusterRole , c .Name ),
60
+ Labels : map [string ]string {
61
+ "app.kubernetes.io/part-of" : config .Name ,
62
+ "app.kubernetes.io/managed-by" : "addon" ,
63
+ },
56
64
},
57
65
Rules : []rbacv1.PolicyRule {
58
66
{
@@ -99,6 +107,10 @@ func (c *IBMObjectCSI) GenerateExternalProvisionerClusterRoleBinding() *rbacv1.C
99
107
return & rbacv1.ClusterRoleBinding {
100
108
ObjectMeta : metav1.ObjectMeta {
101
109
Name : config .GetNameForResource (config .ExternalProvisionerClusterRoleBinding , c .Name ),
110
+ Labels : map [string ]string {
111
+ "app.kubernetes.io/part-of" : config .Name ,
112
+ "app.kubernetes.io/managed-by" : "addon" ,
113
+ },
102
114
},
103
115
Subjects : []rbacv1.Subject {
104
116
{
@@ -120,6 +132,10 @@ func (c *IBMObjectCSI) GenerateSCCForControllerClusterRole() *rbacv1.ClusterRole
120
132
return & rbacv1.ClusterRole {
121
133
ObjectMeta : metav1.ObjectMeta {
122
134
Name : config .GetNameForResource (config .CSIControllerSCCClusterRole , c .Name ),
135
+ Labels : map [string ]string {
136
+ "app.kubernetes.io/part-of" : config .Name ,
137
+ "app.kubernetes.io/managed-by" : "addon" ,
138
+ },
123
139
},
124
140
Rules : []rbacv1.PolicyRule {
125
141
{
@@ -137,6 +153,10 @@ func (c *IBMObjectCSI) GenerateSCCForControllerClusterRoleBinding() *rbacv1.Clus
137
153
return & rbacv1.ClusterRoleBinding {
138
154
ObjectMeta : metav1.ObjectMeta {
139
155
Name : config .GetNameForResource (config .CSIControllerSCCClusterRoleBinding , c .Name ),
156
+ Labels : map [string ]string {
157
+ "app.kubernetes.io/part-of" : config .Name ,
158
+ "app.kubernetes.io/managed-by" : "addon" ,
159
+ },
140
160
},
141
161
Subjects : []rbacv1.Subject {
142
162
{
@@ -158,6 +178,10 @@ func (c *IBMObjectCSI) GenerateSCCForNodeClusterRole() *rbacv1.ClusterRole {
158
178
return & rbacv1.ClusterRole {
159
179
ObjectMeta : metav1.ObjectMeta {
160
180
Name : config .GetNameForResource (config .CSINodeSCCClusterRole , c .Name ),
181
+ Labels : map [string ]string {
182
+ "app.kubernetes.io/part-of" : config .Name ,
183
+ "app.kubernetes.io/managed-by" : "addon" ,
184
+ },
161
185
},
162
186
Rules : []rbacv1.PolicyRule {
163
187
{
@@ -187,6 +211,10 @@ func (c *IBMObjectCSI) GenerateSCCForNodeClusterRoleBinding() *rbacv1.ClusterRol
187
211
return & rbacv1.ClusterRoleBinding {
188
212
ObjectMeta : metav1.ObjectMeta {
189
213
Name : config .GetNameForResource (config .CSINodeSCCClusterRoleBinding , c .Name ),
214
+ Labels : map [string ]string {
215
+ "app.kubernetes.io/part-of" : config .Name ,
216
+ "app.kubernetes.io/managed-by" : "addon" ,
217
+ },
190
218
},
191
219
Subjects : []rbacv1.Subject {
192
220
{
@@ -209,6 +237,10 @@ func (c *IBMObjectCSI) Generates3fsSC() *storagev1.StorageClass {
209
237
return & storagev1.StorageClass {
210
238
ObjectMeta : metav1.ObjectMeta {
211
239
Name : config .GetNameForResource (config .S3fsStorageClass , c .Name ),
240
+ Labels : map [string ]string {
241
+ "app.kubernetes.io/part-of" : config .Name ,
242
+ "app.kubernetes.io/managed-by" : "addon" ,
243
+ },
212
244
},
213
245
Provisioner : config .DriverName ,
214
246
ReclaimPolicy : & reclaimPolicy ,
@@ -237,6 +269,10 @@ func (c *IBMObjectCSI) GenerateRcloneSC() *storagev1.StorageClass {
237
269
return & storagev1.StorageClass {
238
270
ObjectMeta : metav1.ObjectMeta {
239
271
Name : config .GetNameForResource (config .RcloneStorageClass , c .Name ),
272
+ Labels : map [string ]string {
273
+ "app.kubernetes.io/part-of" : config .Name ,
274
+ "app.kubernetes.io/managed-by" : "addon" ,
275
+ },
240
276
},
241
277
Provisioner : config .DriverName ,
242
278
ReclaimPolicy : & reclaimPolicy ,
0 commit comments