From 985c6e7cc90b8d896afac8e1a236756b8aa46011 Mon Sep 17 00:00:00 2001 From: Juan Font Alonso Date: Fri, 15 Oct 2021 00:04:04 +0200 Subject: [PATCH] Preload AuthKey Namespace on list nodes (fixes #163) --- namespaces.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/namespaces.go b/namespaces.go index 2bf62bb3..e109b9a7 100644 --- a/namespaces.go +++ b/namespaces.go @@ -91,7 +91,7 @@ func (h *Headscale) ListMachinesInNamespace(name string) (*[]Machine, error) { } machines := []Machine{} - if err := h.db.Preload("AuthKey").Preload("Namespace").Where(&Machine{NamespaceID: n.ID}).Find(&machines).Error; err != nil { + if err := h.db.Preload("AuthKey").Preload("AuthKey.Namespace").Preload("Namespace").Where(&Machine{NamespaceID: n.ID}).Find(&machines).Error; err != nil { return nil, err } return &machines, nil