open-consul/internal/controller/controller.go

23 lines
486 B
Go
Raw Normal View History

2023-04-25 11:52:35 +00:00
package controller
import (
"context"
"github.com/hashicorp/go-hclog"
)
// controllerRunner contains the actual implementation of running a controller
// including creating watches, calling the reconciler, handling retries, etc.
type controllerRunner struct {
ctrl Controller
logger hclog.Logger
}
func (c *controllerRunner) run(ctx context.Context) error {
c.logger.Debug("controller running")
defer c.logger.Debug("controller stopping")
<-ctx.Done()
return ctx.Err()
}