From 1319177b916942190971f86937ff26f4261a649d 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 e001254a5..a386e2167 100644 --- a/scrapers/kubernetes/kubernetes.go +++ b/scrapers/kubernetes/kubernetes.go @@ -520,6 +520,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 }