Documentation ¶
Index ¶
- Variables
- func Known() map[string]Constructor
- func PodControlledByCluster(cluster metav1.Object, pod *apiv1.Pod, ssLister appslisters.StatefulSetLister) (bool, error)
- func Register(name string, fn Constructor)
- type Action
- type BlockingEventHandler
- type Constructor
- type Context
- type Interface
- type QueuingEventHandler
- type State
Constants ¶
This section is empty.
Variables ¶
var (
KeyFunc = cache.DeletionHandlingMetaNamespaceKeyFunc
)
Functions ¶
func Known ¶
func Known() map[string]Constructor
Known returns a map of the registered controller Constructors
func PodControlledByCluster ¶
func PodControlledByCluster( cluster metav1.Object, pod *apiv1.Pod, ssLister appslisters.StatefulSetLister, ) (bool, error)
func Register ¶
func Register(name string, fn Constructor)
Register registers a controller constructor with the controller package
Types ¶
type Action ¶
type Action interface { Name() string // Execute should attempt to execute the action. If it is not possible to // apply the specified changes (e.g. due to the cluster not being in a // 'ready state', or some transient error) then an error will be returned // so the action can be requeued. This allows for non-blocking blocking of // actions, with retries. The workqueues default scheduling and rate limit // will thus handle fairness within Navigator, and handle backing off on // retries. Execute(state *State) error }
type BlockingEventHandler ¶
type BlockingEventHandler struct {
WorkFunc func(obj interface{})
}
BlockingEventHandler is an implementation of cache.ResourceEventHandler that simply synchronously calls it's WorkFunc upon calls to OnAdd, OnUpdate or OnDelete.
func (*BlockingEventHandler) Enqueue ¶
func (b *BlockingEventHandler) Enqueue(obj interface{})
func (*BlockingEventHandler) OnAdd ¶
func (b *BlockingEventHandler) OnAdd(obj interface{})
func (*BlockingEventHandler) OnDelete ¶
func (b *BlockingEventHandler) OnDelete(obj interface{})
func (*BlockingEventHandler) OnUpdate ¶
func (b *BlockingEventHandler) OnUpdate(old, new interface{})
type Constructor ¶
Constructor is a function that creates a new control loop given a controller Context.
type Context ¶
type Context struct { Client kubernetes.Interface // Recorder to record events to Recorder record.EventRecorder Namespace string }
type Interface ¶
Interface represents a controller that can run. 'workers' should be the number of independent goroutines for this controller in question that are to be run, and the workers should shut down upon a signal on stopCh. This method should block until all workers have exited cleanly, thus allowing for graceful shutdown of control loops.
type QueuingEventHandler ¶
type QueuingEventHandler struct {
Queue workqueue.RateLimitingInterface
}
QueuingEventHandler is an implementation of cache.ResourceEventHandler that simply queues objects that are added/updated/deleted.
func (*QueuingEventHandler) Enqueue ¶
func (q *QueuingEventHandler) Enqueue(obj interface{})
func (*QueuingEventHandler) OnAdd ¶
func (q *QueuingEventHandler) OnAdd(obj interface{})
func (*QueuingEventHandler) OnDelete ¶
func (q *QueuingEventHandler) OnDelete(obj interface{})
func (*QueuingEventHandler) OnUpdate ¶
func (q *QueuingEventHandler) OnUpdate(old, new interface{})
type State ¶
type State struct { // The Clientset to use when performing updates Clientset kubernetes.Interface // The NavigatorClientset to use for updates Recorder record.EventRecorder StatefulSetLister appslisters.StatefulSetLister ConfigMapLister corelisters.ConfigMapLister PilotLister listers.PilotLister PodLister corelisters.PodLister ServiceLister corelisters.ServiceLister ServiceAccountLister corelisters.ServiceAccountLister RoleBindingLister rbaclisters.RoleBindingLister RoleLister rbaclisters.RoleLister }
State contains the current state of the world, including accessors for modifying this state (e.g. kubernetes clientsets)