Skip to content

Commit

Permalink
Fix agent permissions start (#3580)
Browse files Browse the repository at this point in the history
fix(agent): Show error message for users with no admin access
  • Loading branch information
xoscar authored Jan 30, 2024
1 parent 44cfbaf commit d3f2635
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions agent/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ func (s *Runner) onStartAgent(ctx context.Context, cfg config.Config) {
s.ui.Error(err.Error())
}

if env.AgentApiKey == "" {
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.")
return
}

err = s.StartAgent(ctx, cfg.AgentEndpoint, env.AgentApiKey, cfg.UIEndpoint)
if err != nil {
s.ui.Error(err.Error())
Expand Down

0 comments on commit d3f2635

Please sign in to comment.