Documentation
¶
Index ¶
- type Controller
- type ControllerManagerOption
- func WithCacheSyncTimeout(timeout time.Duration) ControllerManagerOption
- func WithConsoleClient(client client.Client) ControllerManagerOption
- func WithConsoleClientArgs(url string, deployToken string) ControllerManagerOption
- func WithJitter(jitter time.Duration) ControllerManagerOption
- func WithLivenessCheckInterval(interval time.Duration) ControllerManagerOption
- func WithMaxConcurrentReconciles(maxConcurrentReconciles int) ControllerManagerOption
- func WithPollInterval(interval time.Duration) ControllerManagerOption
- func WithRecoverPanic(recoverPanic bool) ControllerManagerOption
- func WithSocket(socket websocket.Socket) ControllerManagerOption
- func WithSocketArgs(clusterID, url, deployToken string) ControllerManagerOption
- type Manager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// Name is used to uniquely identify a Controller in tracing, logging and monitoring. Name is required.
Name string
// MaxConcurrentReconciles is the maximum number of concurrent Reconciles which can be run. Defaults to 1.
MaxConcurrentReconciles int
// Reconciler is a function that can be called at any time with the ID of an object and
// ensures that the state of the system matches the state specified in the object.
Do v1.Reconciler
// CacheSyncTimeout refers to the time limit set on waiting for cache to sync
// Defaults to 2 minutes if not set.
CacheSyncTimeout time.Duration
// PollJitter defines how much polling jitter should there be when polling for new resources.
PollJitter time.Duration
// RecoverPanic indicates whether the panic caused by reconcile should be recovered.
RecoverPanic *bool
DeQueueJitter time.Duration
// contains filtered or unexported fields
}
func (*Controller) LastPollTime ¶
func (c *Controller) LastPollTime() time.Time
LastPollTime returns the last time controller poll was executed. It signals whether the controller is alive and running.
func (*Controller) LastReconcileTime ¶
func (c *Controller) LastReconcileTime() time.Time
LastReconcileTime returns the last time controller poll was executed. It signals whether the controller is alive and running.
func (*Controller) Restart ¶
func (c *Controller) Restart()
func (*Controller) SetupWithManager ¶
func (c *Controller) SetupWithManager(manager *Manager)
func (*Controller) Start ¶
func (c *Controller) Start(ctx context.Context)
Start implements controller.Controller.
type ControllerManagerOption ¶
func WithCacheSyncTimeout ¶
func WithCacheSyncTimeout(timeout time.Duration) ControllerManagerOption
func WithConsoleClient ¶
func WithConsoleClient(client client.Client) ControllerManagerOption
func WithConsoleClientArgs ¶
func WithConsoleClientArgs(url string, deployToken string) ControllerManagerOption
func WithJitter ¶
func WithJitter(jitter time.Duration) ControllerManagerOption
func WithLivenessCheckInterval ¶
func WithLivenessCheckInterval(interval time.Duration) ControllerManagerOption
func WithMaxConcurrentReconciles ¶
func WithMaxConcurrentReconciles(maxConcurrentReconciles int) ControllerManagerOption
func WithPollInterval ¶
func WithPollInterval(interval time.Duration) ControllerManagerOption
func WithRecoverPanic ¶
func WithRecoverPanic(recoverPanic bool) ControllerManagerOption
func WithSocket ¶
func WithSocket(socket websocket.Socket) ControllerManagerOption
func WithSocketArgs ¶
func WithSocketArgs(clusterID, url, deployToken string) ControllerManagerOption
type Manager ¶
type Manager struct {
sync.Mutex
Controllers []*Controller
// MaxConcurrentReconciles is the maximum number of concurrent Reconciles which can be run.
MaxConcurrentReconciles int
// CacheSyncTimeout refers to the time limit set on waiting for cache to sync
// Defaults to 2 minutes if not set.
CacheSyncTimeout time.Duration
// RecoverPanic indicates whether the panic caused by reconcile should be recovered.
RecoverPanic *bool
// PollInterval defines how often controllers should poll for new resources.
PollInterval time.Duration
// PollJitter defines how much polling jitter should there be when polling for new resources.
PollJitter time.Duration
// LivenessCheckInterval recheck the controller liveness.
LivenessCheckInterval time.Duration
Socket websocket.Socket
// contains filtered or unexported fields
}
func NewControllerManager ¶
func NewControllerManager(options ...ControllerManagerOption) (*Manager, error)
func (*Manager) AddController ¶
func (cm *Manager) AddController(ctrl *Controller)
func (*Manager) AddReconcilerOrDie ¶
func (cm *Manager) AddReconcilerOrDie(name string, reconcilerGetter func() (v1.Reconciler, error))
func (*Manager) GetReconcilerOrDie ¶
func (cm *Manager) GetReconcilerOrDie(name string) v1.Reconciler
Source Files
¶
Click to show internal directories.
Click to hide internal directories.