Skip to content

Commit

Permalink
Merge pull request #167 from juanfont/authkey-namespace-preload
Browse files Browse the repository at this point in the history
Preload AuthKey Namespace on list nodes
  • Loading branch information
juanfont authored Oct 16, 2021
2 parents 5a7b377 + 0b0f7db commit 271660a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion namespaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 271660a

Please sign in to comment.