mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-06 10:21:05 +02:00
zero: managed mode controller
This commit is contained in:
parent
2f7ea6c194
commit
03c047b311
7 changed files with 295 additions and 2 deletions
24
internal/zero/controller/reconciler.go
Normal file
24
internal/zero/controller/reconciler.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/log"
|
||||
"github.com/pomerium/pomerium/internal/zero/reconciler"
|
||||
"github.com/pomerium/pomerium/pkg/grpc/databroker"
|
||||
)
|
||||
|
||||
func (c *controller) RunReconciler(ctx context.Context) error {
|
||||
leaser := databroker.NewLeaser("zero-reconciler", c.cfg.reconcilerLeaseDuration, c)
|
||||
return leaser.Run(ctx)
|
||||
}
|
||||
|
||||
// RunLeased implements the databroker.Leaser interface.
|
||||
func (c *controller) RunLeased(ctx context.Context) error {
|
||||
log.Ctx(ctx).Info().Msg("starting reconciler")
|
||||
return reconciler.Run(ctx,
|
||||
reconciler.WithAPI(c.api),
|
||||
reconciler.WithConnectMux(c.connectMux),
|
||||
reconciler.WithDataBrokerClient(c.GetDataBrokerServiceClient()),
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue