Skip to content

Commit

Permalink
Merge branch 'main' into arm64-binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfont authored Oct 16, 2021
2 parents 5807562 + 271660a commit ddb6bd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cmd/headscale/cli/preauthkeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ var createPreAuthKeyCmd = &cobra.Command{
}

var expirePreAuthKeyCmd = &cobra.Command{
Use: "expire",
Use: "expire KEY",
Short: "Expire a preauthkey",
Args: func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
Expand All @@ -153,6 +153,10 @@ var expirePreAuthKeyCmd = &cobra.Command{

k, err := h.GetPreAuthKey(n, args[0])
if err != nil {
if strings.HasPrefix(o, "json") {
JsonOutput(k, err, o)
return
}
log.Fatalf("Error getting the key: %s", err)
}

Expand Down
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 ddb6bd7

Please sign in to comment.