Skip to content

Commit d3f2635

Browse files
authored
Fix agent permissions start (#3580)
fix(agent): Show error message for users with no admin access
1 parent 44cfbaf commit d3f2635

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

agent/runner/runner.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ func (s *Runner) onStartAgent(ctx context.Context, cfg config.Config) {
7575
s.ui.Error(err.Error())
7676
}
7777

78+
if env.AgentApiKey == "" {
79+
s.ui.Error("You are attempting to start the agent in an environment you do not have admin rights to. Please ask the administrator of this environment to grant you admin rights.")
80+
return
81+
}
82+
7883
err = s.StartAgent(ctx, cfg.AgentEndpoint, env.AgentApiKey, cfg.UIEndpoint)
7984
if err != nil {
8085
s.ui.Error(err.Error())

0 commit comments

Comments
 (0)