Skip to content

Multi times reconciliations when to watch kubernetes builtin resource. #2517

@nobody4t

Description

@nobody4t

Not sure what kind this issue should be. So I just put it out. Some body may help with it.

Backgroud:
I need to inspect namesapce and do some work according to the changes, like namespace deletion or creation. This is easy with client-go. But I need it to be part of operator, say a controller.
What did I do?
I just create a controller to watch namespace resource.
what did I got ?
I got multiple times of reconciliation of the same events.
Eg. When I create a namespace, this event will be received two times. And the deletion will be 3 times.
The nice result I expect:
Just like other custom resource. I got exact one time reconciliation.
My thoughts:
I not so deep understand the mechanism of the controller-runtime API and operator-sdk.
But from my intuition, I thought this might be problematic when to watch a kubernetes builtin resource.
Because it already got a controller, which might be the cause of this. But not sure.

Is it normal to inspect a kubernetes builtin resource? I think it is good. We already can inspect other resource, like pod, deployment etc. Is it because namespace is a cluster-scoped resource?
Please help.

Metadata

Metadata

Labels

triage/supportIndicates an issue that is a support question.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions