diff --git a/operator/pkg/helper/helper.go b/operator/pkg/helper/helper.go index 7cb11936..bad25dfb 100644 --- a/operator/pkg/helper/helper.go +++ b/operator/pkg/helper/helper.go @@ -90,6 +90,7 @@ func (h *Helper) AddNameAndUID(name string, uid types.UID, kind string) error { h.kind = kind return nil } + func (h *Helper) SetCustomResource(cr *qubershipv1.PatroniServices) error { if helper == nil { message := "cannot set Custom Resource, helper has not been initialized yet" diff --git a/operator/pkg/helper/resource_management.go b/operator/pkg/helper/resource_management.go index 6b67d452..986c2ffe 100644 --- a/operator/pkg/helper/resource_management.go +++ b/operator/pkg/helper/resource_management.go @@ -756,7 +756,6 @@ func (rm *ResourceManager) CreateServiceIfNotExists(service *corev1.Service) err }, foundService) if err != nil && errors.IsNotFound(err) { logger.Info(fmt.Sprintf("Creating %s k8s service", service.Name)) - service.OwnerReferences = rm.GetOwnerReferences() service.Labels = rm.getLabels(service.ObjectMeta) err = rm.kubeClient.Create(context.TODO(), service) if err != nil { @@ -776,7 +775,6 @@ func (rm *ResourceManager) CreateConfigMapIfNotExists(cm *corev1.ConfigMap) erro }, foundCm) if err != nil && errors.IsNotFound(err) { logger.Info(fmt.Sprintf("Creating %s configMap", cm.Name)) - cm.OwnerReferences = rm.GetOwnerReferences() cm.Labels = rm.getLabels(cm.ObjectMeta) err = rm.kubeClient.Create(context.TODO(), cm) if err != nil {