@@ -297,6 +297,10 @@ func configureLabelsAndAnnotations(policyServerDeployment *appsv1.Deployment, po
297
297
}
298
298
policyServerDeployment .Labels [constants .AppLabelKey ] = policyServer .AppLabel ()
299
299
policyServerDeployment .Labels [constants .PolicyServerLabelKey ] = policyServer .Name
300
+
301
+ for key , value := range policyServer .CommonLabels () {
302
+ policyServerDeployment .Labels [key ] = value
303
+ }
300
304
}
301
305
302
306
func (r * PolicyServerReconciler ) configureMutualTLS (ctx context.Context , policyServerDeployment * appsv1.Deployment ) error {
@@ -373,6 +377,15 @@ func buildPolicyServerDeploymentSpec(
373
377
templateAnnotations map [string ]string ,
374
378
podSecurityContext * corev1.PodSecurityContext ,
375
379
) appsv1.DeploymentSpec {
380
+ templateLabels := map [string ]string {
381
+ constants .AppLabelKey : policyServer .AppLabel (),
382
+ constants .PolicyServerDeploymentPodSpecConfigVersionLabel : configMapVersion ,
383
+ constants .PolicyServerLabelKey : policyServer .Name ,
384
+ }
385
+ for key , value := range policyServer .CommonLabels () {
386
+ templateLabels [key ] = value
387
+ }
388
+
376
389
return appsv1.DeploymentSpec {
377
390
Replicas : & policyServer .Spec .Replicas ,
378
391
Selector : & metav1.LabelSelector {
@@ -385,11 +398,7 @@ func buildPolicyServerDeploymentSpec(
385
398
},
386
399
Template : corev1.PodTemplateSpec {
387
400
ObjectMeta : metav1.ObjectMeta {
388
- Labels : map [string ]string {
389
- constants .AppLabelKey : policyServer .AppLabel (),
390
- constants .PolicyServerDeploymentPodSpecConfigVersionLabel : configMapVersion ,
391
- constants .PolicyServerLabelKey : policyServer .Name ,
392
- },
401
+ Labels : templateLabels ,
393
402
Annotations : templateAnnotations ,
394
403
},
395
404
Spec : corev1.PodSpec {
0 commit comments