Merge pull request #1653 from KnicKnic/enable_agent_windows

enable agent to start on windows
pull/1692/head
Darren Shepherd 5 years ago committed by GitHub
commit 7d06d2ccc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,6 +4,7 @@ import (
"context" "context"
"fmt" "fmt"
"os" "os"
"runtime"
"github.com/rancher/k3s/pkg/agent" "github.com/rancher/k3s/pkg/agent"
"github.com/rancher/k3s/pkg/cli/cmds" "github.com/rancher/k3s/pkg/cli/cmds"
@ -19,7 +20,7 @@ func Run(ctx *cli.Context) error {
if err := cmds.InitLogging(); err != nil { if err := cmds.InitLogging(); err != nil {
return err return err
} }
if os.Getuid() != 0 { if os.Getuid() != 0 && runtime.GOOS != "windows" {
return fmt.Errorf("agent must be ran as root") return fmt.Errorf("agent must be ran as root")
} }

Loading…
Cancel
Save