zero: managed mode controller (#4459)

This commit is contained in:
Denis Mishin 2023-08-17 14:22:52 -04:00 committed by Kenneth Jenkins
parent ea8762d706
commit e0236d3737
11 changed files with 417 additions and 2 deletions

View file

@ -0,0 +1,21 @@
package controller
import (
"context"
"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 {
return reconciler.Run(ctx,
reconciler.WithAPI(c.api),
reconciler.WithDataBrokerClient(c.GetDataBrokerServiceClient()),
)
}