Skip to content

non-namespaced objects namespace gets dropped #543

@mjudeikis

Description

@mjudeikis

I have namespaced objects creating non-namespaced objects and watch loop:

err = c.Watch(&source.Kind{Type: &apiextensionsapi.CustomResourceDefinition{}}, &handler.EnqueueRequestForOwner{
		IsController: true,
		OwnerType:    &apiv1alpha1.Request{},
})
if err != nil {
	return err
}

	// Watch for changes to primary resource crdrequest and requeue the owner Namespace
	return c.Watch(&source.Kind{Type: &apiv1alpha1.Request{}}, &handler.EnqueueRequestForObject{})

If apiv1alpha1.Request object gets created natively - watcher send me a request:

Request.Name=example-request Request.Namespace=test

But if Non-namespaced objects gets modified (which is owned by namespaced one) I get request:

Request.Name=example-request Request.Namespace=

Looks like during the lookup of owner object and resolution to the owner object itself namespace gets dropped somehow from the request reconcile.Request object

🤷‍♂️

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions