kubernetes-sigs / controller-runtime

Repo for the controller-runtime subproject of kubebuilder (sig-apimachinery)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cache issue when using receiver

lmeunier-talend opened this issue · comments

Hi,

I have a strange issue and I did not find anything about it on the net

I have defined my CRD in my operator and when i'm looking up a CR that have being created in the cache, it find it

c.Get(ctx, client.ObjectKey{Name: name}, myCR);

But if I add any method with a receiver on my CR struct, it doesn't find the CR anymore in the cache

func (r *myCR) GetNamespace() string {
	return namespace
}

I'm using Kubebuilder and their generated deepcopy is supposed to take receiver into account

Any idea how to fix this ?