@@ -38,7 +38,6 @@ func (r *PolicyServerReconciler) reconcilePolicyServerService(ctx context.Contex
3838 ObjectMeta : metav1.ObjectMeta {
3939 Name : policyServer .NameWithPrefix (),
4040 Namespace : r .DeploymentsNamespace ,
41- Labels : policyServer .CommonLabels (),
4241 },
4342 }
4443 _ , err := controllerutil .CreateOrPatch (ctx , r .Client , & svc , func () error {
@@ -53,9 +52,14 @@ func (r *PolicyServerReconciler) reconcilePolicyServerService(ctx context.Contex
5352func (r * PolicyServerReconciler ) updateService (svc * corev1.Service , policyServer * policiesv1.PolicyServer ) error {
5453 svc .Name = policyServer .NameWithPrefix ()
5554 svc .Namespace = r .DeploymentsNamespace
56- svc .Labels = map [string ]string {
57- constants .AppLabelKey : policyServer .AppLabel (),
55+ templateLabels := map [string ]string {
56+ constants .AppLabelKey : policyServer .AppLabel (),
57+ constants .PolicyServerLabelKey : policyServer .Name ,
5858 }
59+ for key , value := range policyServer .CommonLabels () {
60+ templateLabels [key ] = value
61+ }
62+ svc .Labels = templateLabels
5963 svc .Spec = corev1.ServiceSpec {
6064 Ports : []corev1.ServicePort {
6165 {
0 commit comments