outposts: fix issue with duplicate outpost health

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-05-11 21:46:30 +02:00
parent fd4e8a59f4
commit 5a0e78c698
5 changed files with 19 additions and 10 deletions

View File

@ -8,6 +8,7 @@ import (
"time"
"github.com/go-openapi/runtime"
"github.com/google/uuid"
"github.com/pkg/errors"
"github.com/recws-org/recws"
"goauthentik.io/outpost/pkg"
@ -35,7 +36,8 @@ type APIController struct {
reloadOffset time.Duration
wsConn *recws.RecConn
wsConn *recws.RecConn
instanceUUID uuid.UUID
}
// NewAPIController initialise new API Controller instance from URL and API token
@ -70,6 +72,7 @@ func NewAPIController(akURL url.URL, token string) *APIController {
logger: log,
reloadOffset: time.Duration(rand.Intn(10)) * time.Second,
instanceUUID: uuid.New(),
}
ac.logger.Debugf("HA Reload offset: %s", ac.reloadOffset)
ac.initWS(akURL, outpost.Pk)