From 0ff1f04186b2ee37a3adce21d8fd12a4acead484 Mon Sep 17 00:00:00 2001 From: Matthew R Kasun Date: Thu, 10 Aug 2023 11:19:57 -0400 Subject: [PATCH] associate node to host during migration --- controllers/migrate.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controllers/migrate.go b/controllers/migrate.go index dc69caa03..0f5fe7311 100644 --- a/controllers/migrate.go +++ b/controllers/migrate.go @@ -84,6 +84,9 @@ func migrate(w http.ResponseWriter, r *http.Request) { } else { node = convertLegacyNode(legacyNode, host.ID) } + if err := logic.AssociateNodeToHost(&node, &host); err != nil { + slog.Error("associate node to host", "node", node.ID, "host", host.ID, "hostname", host.Name, "error", err) + } if err := logic.UpsertNode(&node); err != nil { slog.Error("update node", "error", err) continue