-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
I noticed that MapObject.Object instances passed to a handler.ToRequestsFunc function contains empty GroupVersionKind. The code I have looks like the following:
mapFn := handler.ToRequestsFunc(
func(a handler.MapObject) []reconcile.Request {
var requests []reconcile.Request
apps := listApplications(mgr.GetClient(), a.Meta.GetNamespace())
for _, app := range apps {
ref := app.Spec.Selector.ObjectRef
gvk := a.Object.GetObjectKind().GroupVersionKind()
if gvk.Empty() {
log.Printf("Empty GVK for object %s/%s", a.Meta.GetNamespace(), a.Meta.GetName())
return requests
}
if ref != nil && ref.Name == a.Meta.GetName() && ref.Kind == gvk.Kind {
requests = append(requests, reconcile.Request{
NamespacedName: types.NamespacedName{
Namespace: app.Namespace,
Name: app.Name,
},
})
}
}
return requests
})The logs show multiple occurrences of Empty GVK for object ....
Metadata
Metadata
Assignees
Labels
No labels