From 73c08cd76b31279229e589901cea6be821d61c79 Mon Sep 17 00:00:00 2001 From: Tommy Hughes Date: Wed, 7 May 2025 15:10:59 -0500 Subject: [PATCH] fix: Allow custom annotations to Operator installed objects Signed-off-by: Tommy Hughes --- .../internal/controller/services/client.go | 9 ++++----- .../internal/controller/services/services.go | 5 +++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/infra/feast-operator/internal/controller/services/client.go b/infra/feast-operator/internal/controller/services/client.go index 89e22f7be6d..fbd972368fb 100644 --- a/infra/feast-operator/internal/controller/services/client.go +++ b/infra/feast-operator/internal/controller/services/client.go @@ -70,12 +70,11 @@ func (feast *FeastServices) createCaConfigMap() error { } func (feast *FeastServices) setCaConfigMap(cm *corev1.ConfigMap) error { - cm.Labels = map[string]string{ - NameLabelKey: feast.Handler.FeatureStore.Name, - } - cm.Annotations = map[string]string{ - "service.beta.openshift.io/inject-cabundle": "true", + cm.Labels = feast.getLabels() + if len(cm.Annotations) == 0 { + cm.Annotations = map[string]string{} } + cm.Annotations["service.beta.openshift.io/inject-cabundle"] = "true" return controllerutil.SetControllerReference(feast.Handler.FeatureStore, cm, feast.Handler.Scheme) } diff --git a/infra/feast-operator/internal/controller/services/services.go b/infra/feast-operator/internal/controller/services/services.go index 5cc9cc11267..768b4df74b1 100644 --- a/infra/feast-operator/internal/controller/services/services.go +++ b/infra/feast-operator/internal/controller/services/services.go @@ -586,9 +586,10 @@ func (feast *FeastServices) setInitContainer(podSpec *corev1.PodSpec, fsYamlB64 func (feast *FeastServices) setService(svc *corev1.Service, feastType FeastServiceType) error { svc.Labels = feast.getFeastTypeLabels(feastType) if feast.isOpenShiftTls(feastType) { - svc.Annotations = map[string]string{ - "service.beta.openshift.io/serving-cert-secret-name": svc.Name + tlsNameSuffix, + if len(svc.Annotations) == 0 { + svc.Annotations = map[string]string{} } + svc.Annotations["service.beta.openshift.io/serving-cert-secret-name"] = svc.Name + tlsNameSuffix } var port int32 = HttpPort