diff --git a/tool/processors/agentconfig/agentConfig.go b/tool/processors/agentconfig/agentConfig.go index 66b524db92..d7d42ba6fa 100644 --- a/tool/processors/agentconfig/agentConfig.go +++ b/tool/processors/agentconfig/agentConfig.go @@ -36,7 +36,7 @@ func whichRunAsUser(ctx *runtime.Context, config *data.Config) { answer := util.Choice("Which user are you planning to run the agent?", 1, - []string{RUNASUSER_ROOT, RUNASUSER_CWAGENT, RUNASUSER_OTHERS}) + []string{RUNASUSER_CWAGENT, RUNASUSER_ROOT, RUNASUSER_OTHERS}) if answer == RUNASUSER_OTHERS { answer = util.Ask("Please specify your own user(remember the user must exist before the agent running):") diff --git a/tool/processors/agentconfig/agentConfig_test.go b/tool/processors/agentconfig/agentConfig_test.go index d5fdd5167f..a5d04b19e9 100644 --- a/tool/processors/agentconfig/agentConfig_test.go +++ b/tool/processors/agentconfig/agentConfig_test.go @@ -21,15 +21,15 @@ func TestProcessor_Process(t *testing.T) { testutil.Type(inputChan, "") Processor.Process(ctx, conf) - assert.Equal(t, RUNASUSER_ROOT, conf.AgentConfig.Runasuser) + assert.Equal(t, RUNASUSER_CWAGENT, conf.AgentConfig.Runasuser) testutil.Type(inputChan, "1") Processor.Process(ctx, conf) - assert.Equal(t, RUNASUSER_ROOT, conf.AgentConfig.Runasuser) + assert.Equal(t, RUNASUSER_CWAGENT, conf.AgentConfig.Runasuser) testutil.Type(inputChan, "2") Processor.Process(ctx, conf) - assert.Equal(t, RUNASUSER_CWAGENT, conf.AgentConfig.Runasuser) + assert.Equal(t, RUNASUSER_ROOT, conf.AgentConfig.Runasuser) testutil.Type(inputChan, "3", "testuser") Processor.Process(ctx, conf)