operator

package
v0.0.0-...-03429b3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CREATED = EventType("created")
	UPDATED = EventType("updated")
	DELETED = EventType("deleted")
)

Variables

This section is empty.

Functions

func Build

func Build(handler Handler, listenObj runtime.Object, watcher ListWatcher) *controller

func NewPool

func NewPool() *pool

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller is the controller implementation for At resources

func NewController

func NewController(
	kubeClientset kubernetes.Interface,
	swarmClientset clientset.Interface,
	podInformer corev1informer.PodInformer,
	swarmInformer informers.SwarmInformer,
) *Controller

NewController returns a new swarm controller

func (*Controller) Run

func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error

Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.

type Event

type Event interface {
	GetAction() EventType
	GetKey() string
	GetObject() runtime.Object
}

type EventType

type EventType string

type Handler

type Handler interface {
	Created(ctx context.Context, obj runtime.Object)
	Updated(ctx context.Context, new runtime.Object, old runtime.Object)
	Deleted(ctx context.Context, obj runtime.Object)
}

func NewHandler

func NewHandler(p Pool) Handler

type ListWatcher

type ListWatcher interface {
	List(options metav1.ListOptions) (runtime.Object, error)
	Watch(options metav1.ListOptions) (watch.Interface, error)
}

type Pool

type Pool interface {
	Add(idx int, id string, add net.IP) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL