Skip to content

EnqueueRequestForOwner creates reconcile.Request with wrong data  #214

@vasrem

Description

@vasrem

I might be wrong but I find the following behaviour strange.

Lets define the following:

  • Object1 -> Is created during the reconcile of Object2
  • Object2 -> Owner of Object1

I'm watching for Object2 using EnqueueRequestForObject and Object1 with EnqueueRequestForOwner. Object1 is created during the reconcile of Object2. There is a reconcile function for objects of type Object2.

In this line it is defined that the Namespace of the Object that should be reconciled is the Namespace of Object1. This means that if the Object2 is in a different Namespace than Object1 or Object1 has no Namespace at all (Object1 Type is i.e. Namespace) the Reconciler will not find the Object2.

In my case, I'm building an operator that will create Namespaces. If I delete the namespace, then the reconciler cannot find the CR which is the owner of the Namespace and the Namespace will never be recreated.

I could tweak the code to check for the CR in a specific Namespace if the reconcile.Request doesn't contain any Namespace but I would like to know if the behaviour that I'm facing is the correct one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions