controller-runtime: sigs.k8s.io/controller-runtime/pkg/internal/controller Index | Files | Directories

package controller

import "sigs.k8s.io/controller-runtime/pkg/internal/controller"

Index

Package Files

controller.go

type Controller Uses

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 Name / Namespace of an object and
    // ensures that the state of the system matches the state specified in the object.
    // Defaults to the DefaultReconcileFunc.
    Do  reconcile.Reconciler

    // Client is a lazily initialized Client.  The controllerManager will initialize this when Start is called.
    Client client.Client

    // Scheme is injected by the controllerManager when controllerManager.Start is called
    Scheme *runtime.Scheme

    // informers are injected by the controllerManager when controllerManager.Start is called
    Cache cache.Cache

    // Config is the rest.Config used to talk to the apiserver.  Defaults to one of in-cluster, environment variable
    // specified, or the ~/.kube/Config.
    Config *rest.Config

    // MakeQueue constructs the queue for this controller once the controller is ready to start.
    // This exists because the standard Kubernetes workqueues start themselves immediately, which
    // leads to goroutine leaks if something calls controller.New repeatedly.
    MakeQueue func() workqueue.RateLimitingInterface

    // Queue is an listeningQueue that listens for events from Informers and adds object keys to
    // the Queue for processing
    Queue workqueue.RateLimitingInterface

    // SetFields is used to inject dependencies into other objects such as Sources, EventHandlers and Predicates
    SetFields func(i interface{}) error

    // JitterPeriod allows tests to reduce the JitterPeriod so they complete faster
    JitterPeriod time.Duration

    // WaitForCacheSync allows tests to mock out the WaitForCacheSync function to return an error
    // defaults to Cache.WaitForCacheSync
    WaitForCacheSync func(stopCh <-chan struct{}) bool

    // Started is true if the Controller has been Started
    Started bool

    // Recorder is an event recorder for recording Event resources to the
    // Kubernetes API.
    Recorder record.EventRecorder
    // contains filtered or unexported fields
}

Controller implements controller.Controller

func (*Controller) InjectFunc Uses

func (c *Controller) InjectFunc(f inject.Func) error

InjectFunc implement SetFields.Injector

func (*Controller) Reconcile Uses

func (c *Controller) Reconcile(r reconcile.Request) (reconcile.Result, error)

Reconcile implements reconcile.Reconciler

func (*Controller) Start Uses

func (c *Controller) Start(stop <-chan struct{}) error

Start implements controller.Controller

func (*Controller) Watch Uses

func (c *Controller) Watch(src source.Source, evthdler handler.EventHandler, prct ...predicate.Predicate) error

Watch implements controller.Controller

Directories

PathSynopsis
metrics

Package controller imports 18 packages (graph) and is imported by 6 packages. Updated 2019-10-30. Refresh now. Tools for package owners.