From e322ccee0940c25542277c378e7c347eccbfde1c Mon Sep 17 00:00:00 2001 From: Abhishek Kondur Date: Tue, 10 Jan 2023 19:54:43 +0530 Subject: [PATCH] skip same host --- logic/hosts.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/logic/hosts.go b/logic/hosts.go index 98207fe4..6165a368 100644 --- a/logic/hosts.go +++ b/logic/hosts.go @@ -299,6 +299,9 @@ func GetRelatedHosts(hostID string) []models.Host { hosts, err := GetAllHosts() if err == nil { for _, host := range hosts { + if host.ID.String() == hostID { + continue + } networks := GetHostNetworks(host.ID.String()) for _, network := range networks { if _, ok := networkMap[network]; ok {