From db4ff20906754eff15551c48a7e163561f5d73f9 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 20 Oct 2020 09:36:26 +0200 Subject: [PATCH] outposts: fix service using incorrect pod selector --- passbook/outposts/controllers/k8s/service.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/passbook/outposts/controllers/k8s/service.py b/passbook/outposts/controllers/k8s/service.py index 440e6fe57..4937deb42 100644 --- a/passbook/outposts/controllers/k8s/service.py +++ b/passbook/outposts/controllers/k8s/service.py @@ -7,6 +7,7 @@ from passbook.outposts.controllers.k8s.base import ( KubernetesObjectReconciler, NeedsUpdate, ) +from passbook.outposts.controllers.k8s.deployment import DeploymentReconciler if TYPE_CHECKING: from passbook.outposts.controllers.kubernetes import KubernetesController @@ -36,9 +37,10 @@ class ServiceReconciler(KubernetesObjectReconciler[V1Service]): ports = [] for port_name, port in self.controller.deployment_ports.items(): ports.append(V1ServicePort(name=port_name, port=port)) + selector_labels = DeploymentReconciler(self.controller).get_pod_meta() return V1Service( metadata=meta, - spec=V1ServiceSpec(ports=ports, selector=meta.labels, type="ClusterIP"), + spec=V1ServiceSpec(ports=ports, selector=selector_labels, type="ClusterIP"), ) def create(self, reference: V1Service):