cmd/tailscale/cli: show rotation key when suggesting lock sign command

Signed-off-by: Tom DNetto <tom@tailscale.com>
pull/6574/head
Tom DNetto 2 years ago committed by Tom
parent a6dff4fb74
commit 731be07777

@ -168,12 +168,17 @@ func runNetworkLockStatus(ctx context.Context, args []string) error {
} }
fmt.Println() fmt.Println()
if st.Enabled && st.NodeKey != nil { if st.Enabled && st.NodeKey != nil && !st.PublicKey.IsZero() {
if st.NodeKeySigned { if st.NodeKeySigned {
fmt.Println("This node is accessible under tailnet-lock.") fmt.Println("This node is accessible under tailnet-lock.")
} else { } else {
p, err := st.PublicKey.MarshalText()
if err != nil {
return err
}
fmt.Println("This node is LOCKED OUT by tailnet-lock, and action is required to establish connectivity.") fmt.Println("This node is LOCKED OUT by tailnet-lock, and action is required to establish connectivity.")
fmt.Printf("Run the following command on a node with a trusted key:\n\ttailscale lock sign %v\n", st.NodeKey) fmt.Printf("Run the following command on a node with a trusted key:\n\ttailscale lock sign %v %s\n", st.NodeKey, p)
} }
fmt.Println() fmt.Println()
} }

Loading…
Cancel
Save