Skip to content

Commit

Permalink
fix(agent/register): avoid unnecessary config validation
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuar committed Oct 6, 2023
1 parent 035430a commit 9ce8a4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/agent/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ func (agent *Agent) registrationProcess(ctx context.Context, server, token strin
// If the config is valid, but the agent is not registered, set the agent as
// registered and continue execution. Required check for versions upgraded
// from v1.2.6 and below.
if config.ValidateConfig(agent.config) == nil {
if !registered {
if !registered {
if config.ValidateConfig(agent.config) == nil {
if err := agent.config.Set(config.PrefRegistered, true); err != nil {
log.Fatal().Err(err).Msg("Could not set registered status.")
}
Expand Down

0 comments on commit 9ce8a4b

Please sign in to comment.