kedacore / keda-olm-operator

Operator for deploying KEDA Controller on OperatorHub.io/OLM
Apache License 2.0
31 stars 22 forks source link

Don't set ownerReference on cluster-scoped and cross-namespace objects #196

Closed joelsmith closed 1 year ago

joelsmith commented 1 year ago

A user noticed that the OLM operator was trying and failing to create a rolebinding in the kube-system namespace because it tries to add an owner reference to the kedacontroller object from a different namespace.

$ kubectl get events -n kube-system|grep -i keda
4m51s       Warning   OwnerRefInvalidNamespace   rolebinding/keda-auth-reader   ownerRef [keda.sh/v1alpha1/KedaController, namespace: kube-system, name: keda, uid: 1e9a6cd3-17e8-4dec-832f-64ab6db759fe] does not exist in namespace "kube-system"

This change makes it so that the OLM operator will only set the owner reference on objects in the same namespace as the kedacontroller object.

Checklist