From 7f77c9a3c8b4e70e80a9aa763bff5a30777b142f Mon Sep 17 00:00:00 2001 From: Knic Knic Date: Sat, 18 Apr 2020 23:38:16 -0700 Subject: [PATCH] enable agent to start on windows --- pkg/cli/agent/agent.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/cli/agent/agent.go b/pkg/cli/agent/agent.go index 1ce8624333..f39afda33e 100644 --- a/pkg/cli/agent/agent.go +++ b/pkg/cli/agent/agent.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "os" + "runtime" "github.com/rancher/k3s/pkg/agent" "github.com/rancher/k3s/pkg/cli/cmds" @@ -19,7 +20,7 @@ func Run(ctx *cli.Context) error { if err := cmds.InitLogging(); err != nil { return err } - if os.Getuid() != 0 { + if os.Getuid() != 0 && runtime.GOOS != "windows" { return fmt.Errorf("agent must be ran as root") }