Unverified Commit 95245c99 authored by Manuel Buil's avatar Manuel Buil Committed by GitHub

Merge pull request #7776 from manuelbuil/fixErrorReport

Fix error logging in tailscale
parents b66a1183 43611bb5
...@@ -2,13 +2,13 @@ package vpn ...@@ -2,13 +2,13 @@ package vpn
import ( import (
"encoding/json" "encoding/json"
"errors"
"fmt" "fmt"
"net" "net"
"strings" "strings"
"github.com/k3s-io/k3s/pkg/util" "github.com/k3s-io/k3s/pkg/util"
"github.com/pkg/errors"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
...@@ -44,11 +44,11 @@ func StartVPN(vpnAuthConfigFile string) error { ...@@ -44,11 +44,11 @@ func StartVPN(vpnAuthConfigFile string) error {
logrus.Infof("Starting VPN: %s", authInfo.Name) logrus.Infof("Starting VPN: %s", authInfo.Name)
switch authInfo.Name { switch authInfo.Name {
case "tailscale": case "tailscale":
outpt, err := util.ExecCommand("tailscale", []string{"up", "--authkey", authInfo.JoinKey, "--reset"}) output, err := util.ExecCommand("tailscale", []string{"up", "--authkey", authInfo.JoinKey, "--reset"})
if err != nil { if err != nil {
return err return errors.Wrap(err, "tailscale up failed: "+output)
} }
logrus.Debugf("Output from tailscale up: %v", outpt) logrus.Debugf("Output from tailscale up: %v", output)
return nil return nil
default: default:
return fmt.Errorf("Requested VPN: %s is not supported. We currently only support tailscale", authInfo.Name) return fmt.Errorf("Requested VPN: %s is not supported. We currently only support tailscale", authInfo.Name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment