Allow agent to run rootless

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
pull/6517/head
Brad Davidson 2 years ago committed by Brad Davidson
parent 6f2b21c5cd
commit 56bf7d6ad3

@ -33,8 +33,8 @@ func Run(ctx *cli.Context) error {
return err
}
if os.Getuid() != 0 && runtime.GOOS != "windows" {
return fmt.Errorf("agent must be ran as root")
if runtime.GOOS != "windows" && os.Getuid() != 0 && !cmds.AgentConfig.Rootless {
return fmt.Errorf("agent must be run as root, or with --rootless")
}
if cmds.AgentConfig.TokenFile != "" {

@ -71,7 +71,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
}
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 {

Loading…
Cancel
Save