Commit 56bf7d6a authored by Brad Davidson's avatar Brad Davidson Committed by Brad Davidson

Allow agent to run rootless

parent 6f2b21c5
...@@ -33,8 +33,8 @@ func Run(ctx *cli.Context) error { ...@@ -33,8 +33,8 @@ func Run(ctx *cli.Context) error {
return err return err
} }
if os.Getuid() != 0 && runtime.GOOS != "windows" { if runtime.GOOS != "windows" && os.Getuid() != 0 && !cmds.AgentConfig.Rootless {
return fmt.Errorf("agent must be ran as root") return fmt.Errorf("agent must be run as root, or with --rootless")
} }
if cmds.AgentConfig.TokenFile != "" { if cmds.AgentConfig.TokenFile != "" {
......
...@@ -71,7 +71,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont ...@@ -71,7 +71,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
} }
if !cfg.DisableAgent && os.Getuid() != 0 && !cfg.Rootless { if !cfg.DisableAgent && os.Getuid() != 0 && !cfg.Rootless {
return fmt.Errorf("must run as root unless --disable-agent is specified") return fmt.Errorf("server must run as root, or with --rootless and/or --disable-agent")
} }
if cfg.Rootless { if cfg.Rootless {
......
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