Skip to content

Commit

Permalink
No namespaced owners on non-namespaces resources
Browse files Browse the repository at this point in the history
The operator does not need the owner references for anything. Stop
setting them on all objects.

The background why we do this change is that we were setting some owner
references on non-namespaces objects and the owner was namespaced. This
is not allowed and can result in strange side effects.

Signed-off-by: Roman Mohr <[email protected]>
  • Loading branch information
rmohr committed Jan 3, 2020
1 parent 301898a commit 0bd0b64
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
3 changes: 0 additions & 3 deletions pkg/virt-operator/install-strategy/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ func injectOperatorMetadata(kv *v1.KubeVirt, objectMeta *metav1.ObjectMeta, vers
objectMeta.Annotations[v1.InstallStrategyVersionAnnotation] = version
objectMeta.Annotations[v1.InstallStrategyRegistryAnnotation] = imageRegistry
objectMeta.Annotations[v1.InstallStrategyIdentifierAnnotation] = id

objectMeta.OwnerReferences = []metav1.OwnerReference{*metav1.NewControllerRef(kv, v1.KubeVirtGroupVersionKind)}

}

func generatePatchBytes(ops []string) []byte {
Expand Down
1 change: 0 additions & 1 deletion pkg/virt-operator/kubevirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ func NewKubeVirtController(
}

func (c *KubeVirtController) getKubeVirtKey() (string, error) {
// XXX use owner references instead in general
kvs := c.kubeVirtInformer.GetStore().List()
if len(kvs) > 1 {
log.Log.Errorf("More than one KubeVirt custom resource detected: %v", len(kvs))
Expand Down

0 comments on commit 0bd0b64

Please sign in to comment.