From 6b3657c7b38c8ffddb62051d9a07736eb490475d Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Fri, 6 Dec 2024 10:09:52 +0545 Subject: [PATCH] fix: endpoints parent should be the service --- scrapers/kubernetes/kubernetes.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scrapers/kubernetes/kubernetes.go b/scrapers/kubernetes/kubernetes.go index 19664850..de573532 100644 --- a/scrapers/kubernetes/kubernetes.go +++ b/scrapers/kubernetes/kubernetes.go @@ -521,6 +521,13 @@ func getKubernetesParent(ctx *KubernetesContext, obj *unstructured.Unstructured) allParents = append(ParentLookupHooks(ctx, obj), allParents...) + if obj.GetKind() == "Endpoints" { + allParents = append([]v1.ConfigExternalKey{{ + Type: ConfigTypePrefix + "Service", + ExternalID: alias("Service", obj.GetNamespace(), obj.GetName()), + }}, allParents...) + } + return allParents }