From 0bef10ef80c69bf7f79f0a861c061e94e60e5481 Mon Sep 17 00:00:00 2001 From: Mark Sagi-Kazar Date: Wed, 26 May 2021 14:50:35 +0200 Subject: [PATCH] chore(deps): update gosundheit Signed-off-by: Mark Sagi-Kazar --- cmd/dex/serve.go | 10 +++++----- go.mod | 2 +- go.sum | 4 ++-- server/handlers_test.go | 12 ++++++------ storage/health.go | 5 +++-- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/cmd/dex/serve.go b/cmd/dex/serve.go index aaf36b32..fd7da833 100644 --- a/cmd/dex/serve.go +++ b/cmd/dex/serve.go @@ -336,14 +336,14 @@ func runServe(options serveOptions) error { telemetryRouter.Handle("/healthz/ready", handler) } - healthChecker.RegisterCheck(&gosundheit.Config{ - Check: &checks.CustomCheck{ + healthChecker.RegisterCheck( + &checks.CustomCheck{ CheckName: "storage", CheckFunc: storage.NewCustomHealthCheckFunc(serverConfig.Storage, serverConfig.Now), }, - ExecutionPeriod: 15 * time.Second, - InitiallyPassing: true, - }) + gosundheit.ExecutionPeriod(15*time.Second), + gosundheit.InitiallyPassing(true), + ) var group run.Group diff --git a/go.mod b/go.mod index b3cb6aa8..3baeaa26 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( entgo.io/ent v0.8.0 - github.com/AppsFlyer/go-sundheit v0.3.1 + github.com/AppsFlyer/go-sundheit v0.4.0 github.com/beevik/etree v1.1.0 github.com/coreos/go-oidc/v3 v3.0.0 github.com/dexidp/dex/api/v2 v2.0.0 diff --git a/go.sum b/go.sum index 8bc5794c..713a288f 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= entgo.io/ent v0.8.0 h1:xirrW//1oda7pp0bz+XssSOv4/C3nmgYQOxjIfljFt8= entgo.io/ent v0.8.0/go.mod h1:KNjsukat/NJi6zJh1utwRadsbGOZsBbAZNDxkW7tMCc= -github.com/AppsFlyer/go-sundheit v0.3.1 h1:Zqnr3wV3WQmXonc234k9XZAoV2KHUHw3osR5k2iHQZE= -github.com/AppsFlyer/go-sundheit v0.3.1/go.mod h1:iZ8zWMS7idcvmqewf5mEymWWgoOiG/0WD4+aeh+heX4= +github.com/AppsFlyer/go-sundheit v0.4.0 h1:7ECd0YWaXJQ9LzdCFrpGxJVeAgXvNarN6uwxrJsh69A= +github.com/AppsFlyer/go-sundheit v0.4.0/go.mod h1:iZ8zWMS7idcvmqewf5mEymWWgoOiG/0WD4+aeh+heX4= github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c h1:/IBSNwUN8+eKzUzbJPqhK839ygXJ82sde8x3ogr6R28= github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= diff --git a/server/handlers_test.go b/server/handlers_test.go index d195af64..a1c60102 100644 --- a/server/handlers_test.go +++ b/server/handlers_test.go @@ -43,16 +43,16 @@ func TestHandleHealthFailure(t *testing.T) { httpServer, server := newTestServer(ctx, t, func(c *Config) { c.HealthChecker = gosundheit.New() - c.HealthChecker.RegisterCheck(&gosundheit.Config{ - Check: &checks.CustomCheck{ + c.HealthChecker.RegisterCheck( + &checks.CustomCheck{ CheckName: "fail", - CheckFunc: func() (details interface{}, err error) { + CheckFunc: func(_ context.Context) (details interface{}, err error) { return nil, errors.New("error") }, }, - InitiallyPassing: false, - ExecutionPeriod: 1 * time.Second, - }) + gosundheit.InitiallyPassing(false), + gosundheit.ExecutionPeriod(1*time.Second), + ) }) defer httpServer.Close() diff --git a/storage/health.go b/storage/health.go index 5df0373d..8a2f5a3d 100644 --- a/storage/health.go +++ b/storage/health.go @@ -1,13 +1,14 @@ package storage import ( + "context" "fmt" "time" ) // NewCustomHealthCheckFunc returns a new health check function. -func NewCustomHealthCheckFunc(s Storage, now func() time.Time) func() (details interface{}, err error) { - return func() (details interface{}, err error) { +func NewCustomHealthCheckFunc(s Storage, now func() time.Time) func(context.Context) (details interface{}, err error) { + return func(_ context.Context) (details interface{}, err error) { a := AuthRequest{ ID: NewID(), ClientID: NewID(),