diff --git a/cmd/opampsupervisor/supervisor/commander/commander.go b/cmd/opampsupervisor/supervisor/commander/commander.go index ec556d366f6b..6a937dcd752a 100644 --- a/cmd/opampsupervisor/supervisor/commander/commander.go +++ b/cmd/opampsupervisor/supervisor/commander/commander.go @@ -155,7 +155,7 @@ func (c *Commander) Stop(ctx context.Context) error { go func() { <-waitCtx.Done() - if waitCtx.Err() != context.DeadlineExceeded { + if !errors.Is(waitCtx.Err(), context.DeadlineExceeded) { c.logger.Debug("Agent process successfully stopped.", zap.Int("pid", c.cmd.Process.Pid)) return } diff --git a/cmd/opampsupervisor/supervisor/supervisor.go b/cmd/opampsupervisor/supervisor/supervisor.go index 8b6991f7834b..8c1da51d3385 100644 --- a/cmd/opampsupervisor/supervisor/supervisor.go +++ b/cmd/opampsupervisor/supervisor/supervisor.go @@ -524,7 +524,7 @@ func (s *Supervisor) healthCheck() { health.Healthy = false if !s.agentHasStarted && s.agentStartHealthCheckAttempts < 10 { health.LastError = "Agent is starting" - s.agentStartHealthCheckAttempts += 1 + s.agentStartHealthCheckAttempts++ } else { health.LastError = err.Error() s.logger.Error("Agent is not healthy", zap.Error(err))