@@ -28,9 +28,10 @@ func DefaultServiceAccount(component string) RenderFunc {
28
28
& corev1.ServiceAccount {
29
29
TypeMeta : TypeMetaServiceAccount ,
30
30
ObjectMeta : metav1.ObjectMeta {
31
- Name : component ,
32
- Namespace : cfg .Namespace ,
33
- Labels : DefaultLabels (component ),
31
+ Name : component ,
32
+ Namespace : cfg .Namespace ,
33
+ Labels : CustomOverrideLabel (cfg , component , TypeMetaServiceAccount ),
34
+ Annotations : CustomOverrideAnnotation (cfg , component , TypeMetaServiceAccount ),
34
35
},
35
36
AutomountServiceAccountToken : pointer .Bool (true ),
36
37
ImagePullSecrets : pullSecrets ,
@@ -81,6 +82,18 @@ func GenerateService(component string, ports []ServicePort, mod ...func(spec *co
81
82
m (service )
82
83
}
83
84
85
+ // Apply any custom overrides - perform after the custom modifications so they can overridden
86
+
87
+ // Annotations
88
+ service .ObjectMeta .Annotations = CustomOverrideAnnotation (cfg , component , TypeMetaService , func () map [string ]string {
89
+ return service .ObjectMeta .Annotations
90
+ })
91
+
92
+ // Labels
93
+ service .ObjectMeta .Labels = CustomOverrideLabel (cfg , component , TypeMetaService , func () map [string ]string {
94
+ return service .ObjectMeta .Labels
95
+ })
96
+
84
97
return []runtime.Object {service }, nil
85
98
}
86
99
}
0 commit comments