mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-28 15:38:05 +02:00
health-check: building config from databroker source
This commit is contained in:
parent
b1feff5d56
commit
e23cde506d
2 changed files with 5 additions and 0 deletions
|
@ -21,6 +21,7 @@ import (
|
||||||
configpb "github.com/pomerium/pomerium/pkg/grpc/config"
|
configpb "github.com/pomerium/pomerium/pkg/grpc/config"
|
||||||
"github.com/pomerium/pomerium/pkg/grpc/databroker"
|
"github.com/pomerium/pomerium/pkg/grpc/databroker"
|
||||||
"github.com/pomerium/pomerium/pkg/grpcutil"
|
"github.com/pomerium/pomerium/pkg/grpcutil"
|
||||||
|
"github.com/pomerium/pomerium/pkg/health"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ConfigSource provides a new Config source that decorates an underlying config with
|
// ConfigSource provides a new Config source that decorates an underlying config with
|
||||||
|
@ -100,9 +101,11 @@ func (src *ConfigSource) rebuild(ctx context.Context, firstTime firstTime) {
|
||||||
now = time.Now()
|
now = time.Now()
|
||||||
err := src.buildNewConfigLocked(ctx, cfg)
|
err := src.buildNewConfigLocked(ctx, cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
health.ReportError(health.BuildDatabrokerConfig, err)
|
||||||
log.Error(ctx).Err(err).Msg("databroker: failed to build new config")
|
log.Error(ctx).Err(err).Msg("databroker: failed to build new config")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
health.ReportOK(health.BuildDatabrokerConfig)
|
||||||
log.Debug(ctx).Str("elapsed", time.Since(now).String()).Msg("databroker: built new config")
|
log.Debug(ctx).Str("elapsed", time.Since(now).String()).Msg("databroker: built new config")
|
||||||
|
|
||||||
src.computedConfig = cfg
|
src.computedConfig = cfg
|
||||||
|
|
|
@ -5,6 +5,8 @@ import "fmt"
|
||||||
type Check string
|
type Check string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
// BuildDatabrokerConfig checks whether the Databroker config was applied
|
||||||
|
BuildDatabrokerConfig = Check("config.databroker.build")
|
||||||
// StorageBackend checks whether the storage backend is healthy
|
// StorageBackend checks whether the storage backend is healthy
|
||||||
StorageBackend = Check("storage.backend")
|
StorageBackend = Check("storage.backend")
|
||||||
// XDSCluster checks whether the XDS Cluster resources were applied
|
// XDSCluster checks whether the XDS Cluster resources were applied
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue