@@ -23,6 +23,7 @@ import (
2323 "github.com/openstack-k8s-operators/lib-common/modules/common/secret"
2424 "github.com/openstack-k8s-operators/lib-common/modules/common/service"
2525 "github.com/openstack-k8s-operators/lib-common/modules/common/tls"
26+ "github.com/openstack-k8s-operators/lib-common/modules/common/util"
2627 manilav1 "github.com/openstack-k8s-operators/manila-operator/api/v1beta1"
2728 mariadbv1 "github.com/openstack-k8s-operators/mariadb-operator/api/v1beta1"
2829 neutronv1 "github.com/openstack-k8s-operators/neutron-operator/api/v1beta1"
@@ -57,6 +58,12 @@ const (
5758
5859 // ClusterInternalDomain - cluster internal dns domain
5960 ClusterInternalDomain = "cluster.local"
61+
62+ // serviceCertSelector selector passed to cert-manager to set on the service cert secret
63+ serviceCertSelector = "service-cert"
64+
65+ // caCertSelector selector passed to cert-manager to set on the ca cert secret
66+ caCertSelector = "ca-cert"
6067)
6168
6269// GetLog returns a logger object with a prefix of "controller.name" and aditional controller context fields
@@ -288,7 +295,7 @@ func EnsureEndpointConfig(
288295 },
289296 Ips : nil ,
290297 Annotations : ed .Annotations ,
291- Labels : ed .Labels ,
298+ Labels : util . MergeMaps ( ed .Labels , map [ string ] string { serviceCertSelector : "" }) ,
292299 Usages : nil ,
293300 }
294301 if instance .Spec .TLS .Ingress .Cert .Duration != nil {
@@ -333,7 +340,7 @@ func EnsureEndpointConfig(
333340 },
334341 Ips : nil ,
335342 Annotations : ed .Annotations ,
336- Labels : ed .Labels ,
343+ Labels : util . MergeMaps ( ed .Labels , map [ string ] string { serviceCertSelector : "" }) ,
337344 Usages : nil ,
338345 }
339346 if instance .Spec .TLS .PodLevel .Internal .Cert .Duration != nil {
@@ -554,7 +561,7 @@ func (ed *EndpointDetail) CreateRoute(
554561 Hostnames : []string {* ed .Hostname },
555562 Ips : nil ,
556563 Annotations : ed .Annotations ,
557- Labels : ed .Labels ,
564+ Labels : util . MergeMaps ( ed .Labels , map [ string ] string { serviceCertSelector : "" }) ,
558565 Usages : nil ,
559566 }
560567 if instance .Spec .TLS .Ingress .Cert .Duration != nil {
0 commit comments