From b6d9b6910fcd3a5e1a56bfc138479351e39027ae Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 20 Aug 2024 14:59:06 +0200 Subject: [PATCH] correct is DC link --- models/workflow/workflow.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/models/workflow/workflow.go b/models/workflow/workflow.go index ee7f7d1..0ea3a40 100644 --- a/models/workflow/workflow.go +++ b/models/workflow/workflow.go @@ -4,7 +4,6 @@ import ( "encoding/json" "errors" "fmt" - "slices" "strings" "time" @@ -25,10 +24,10 @@ type AbstractWorkflow struct { } func (w *AbstractWorkflow) isDCLink(link graph.GraphLink) (bool, string) { - if slices.Contains(w.Datacenters, link.Source.ID) { + if d, ok := w.Graph.Items[link.Source.ID]; ok && d.Datacenter != nil { return true, link.Source.ID } - if slices.Contains(w.Datacenters, link.Destination.ID) { + if d, ok := w.Graph.Items[link.Destination.ID]; ok && d.Datacenter != nil { return true, link.Destination.ID } return false, ""