Merge branch 'main' into patch-1

This commit is contained in:
Kristoffer Dalby 2022-05-08 22:55:19 +01:00 committed by GitHub
commit 21268f7abe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,7 @@ import (
"github.com/pterm/pterm"
"github.com/spf13/cobra"
"google.golang.org/grpc/status"
"inet.af/netaddr"
"tailscale.com/types/key"
)
@ -452,6 +453,17 @@ func nodesToPtables(
// Shared into this namespace
namespace = pterm.LightYellow(machine.Namespace.Name)
}
var IpV4Address string
var IpV6Address string
for _, addr := range machine.IpAddresses {
if netaddr.MustParseIP(addr).Is4() {
IpV4Address = addr
} else {
IpV6Address = addr
}
}
tableData = append(
tableData,
[]string{
@ -459,7 +471,7 @@ func nodesToPtables(
machine.Name,
nodeKey.ShortString(),
namespace,
strings.Join(machine.IpAddresses, ", "),
strings.Join([]string{IpV4Address, IpV6Address}, ", "),
strconv.FormatBool(ephemeral),
lastSeenTime,
online,