Merge pull request #2141 from dexidp/update-gosundheit
Update gosundheit
This commit is contained in:
commit
aef61cea8d
@ -336,14 +336,14 @@ func runServe(options serveOptions) error {
|
|||||||
telemetryRouter.Handle("/healthz/ready", handler)
|
telemetryRouter.Handle("/healthz/ready", handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
healthChecker.RegisterCheck(&gosundheit.Config{
|
healthChecker.RegisterCheck(
|
||||||
Check: &checks.CustomCheck{
|
&checks.CustomCheck{
|
||||||
CheckName: "storage",
|
CheckName: "storage",
|
||||||
CheckFunc: storage.NewCustomHealthCheckFunc(serverConfig.Storage, serverConfig.Now),
|
CheckFunc: storage.NewCustomHealthCheckFunc(serverConfig.Storage, serverConfig.Now),
|
||||||
},
|
},
|
||||||
ExecutionPeriod: 15 * time.Second,
|
gosundheit.ExecutionPeriod(15*time.Second),
|
||||||
InitiallyPassing: true,
|
gosundheit.InitiallyPassing(true),
|
||||||
})
|
)
|
||||||
|
|
||||||
var group run.Group
|
var group run.Group
|
||||||
|
|
||||||
|
2
go.mod
2
go.mod
@ -4,7 +4,7 @@ go 1.16
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
entgo.io/ent v0.8.0
|
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/beevik/etree v1.1.0
|
||||||
github.com/coreos/go-oidc/v3 v3.0.0
|
github.com/coreos/go-oidc/v3 v3.0.0
|
||||||
github.com/dexidp/dex/api/v2 v2.0.0
|
github.com/dexidp/dex/api/v2 v2.0.0
|
||||||
|
4
go.sum
4
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=
|
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 h1:xirrW//1oda7pp0bz+XssSOv4/C3nmgYQOxjIfljFt8=
|
||||||
entgo.io/ent v0.8.0/go.mod h1:KNjsukat/NJi6zJh1utwRadsbGOZsBbAZNDxkW7tMCc=
|
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.4.0 h1:7ECd0YWaXJQ9LzdCFrpGxJVeAgXvNarN6uwxrJsh69A=
|
||||||
github.com/AppsFlyer/go-sundheit v0.3.1/go.mod h1:iZ8zWMS7idcvmqewf5mEymWWgoOiG/0WD4+aeh+heX4=
|
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 h1:/IBSNwUN8+eKzUzbJPqhK839ygXJ82sde8x3ogr6R28=
|
||||||
github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU=
|
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=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
|
@ -43,16 +43,16 @@ func TestHandleHealthFailure(t *testing.T) {
|
|||||||
httpServer, server := newTestServer(ctx, t, func(c *Config) {
|
httpServer, server := newTestServer(ctx, t, func(c *Config) {
|
||||||
c.HealthChecker = gosundheit.New()
|
c.HealthChecker = gosundheit.New()
|
||||||
|
|
||||||
c.HealthChecker.RegisterCheck(&gosundheit.Config{
|
c.HealthChecker.RegisterCheck(
|
||||||
Check: &checks.CustomCheck{
|
&checks.CustomCheck{
|
||||||
CheckName: "fail",
|
CheckName: "fail",
|
||||||
CheckFunc: func() (details interface{}, err error) {
|
CheckFunc: func(_ context.Context) (details interface{}, err error) {
|
||||||
return nil, errors.New("error")
|
return nil, errors.New("error")
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
InitiallyPassing: false,
|
gosundheit.InitiallyPassing(false),
|
||||||
ExecutionPeriod: 1 * time.Second,
|
gosundheit.ExecutionPeriod(1*time.Second),
|
||||||
})
|
)
|
||||||
})
|
})
|
||||||
defer httpServer.Close()
|
defer httpServer.Close()
|
||||||
|
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
package storage
|
package storage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewCustomHealthCheckFunc returns a new health check function.
|
// NewCustomHealthCheckFunc returns a new health check function.
|
||||||
func NewCustomHealthCheckFunc(s Storage, now func() time.Time) func() (details interface{}, err error) {
|
func NewCustomHealthCheckFunc(s Storage, now func() time.Time) func(context.Context) (details interface{}, err error) {
|
||||||
return func() (details interface{}, err error) {
|
return func(_ context.Context) (details interface{}, err error) {
|
||||||
a := AuthRequest{
|
a := AuthRequest{
|
||||||
ID: NewID(),
|
ID: NewID(),
|
||||||
ClientID: NewID(),
|
ClientID: NewID(),
|
||||||
|
Reference in New Issue
Block a user