controller

package
v0.0.0-...-1aaf684 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AmbiguousReferenceError

func AmbiguousReferenceError(err error) error

AmbiguousReferenceError wraps the given error and makes it into an ambiguous reference one

func GetObjectFromLabels

func GetObjectFromLabels(lister Lister, namespace string, selector labels.Selector) (runtime.Object, error)

GetObjectFromLabels returns the only object satisfying the required selector.

Among the possible errors, TransientError is returned if it's not possible to reply at this point, or AmbiguousReferenceError if more than one object satisfies the selector.

func GetObjectFromReference

func GetObjectFromReference(lister Lister, namespace string, ref *corev1.LocalObjectReference) (runtime.Object, error)

GetObjectFromReference returns the object pointed by the reference, if it exists.

Among the possible errors, TransientError is returned if it's not possible to reply at this point.

func GetObjectFromReferenceOrSelector

func GetObjectFromReferenceOrSelector(lister Lister, namespace string, ref *corev1.LocalObjectReference, selector labels.Selector) (runtime.Object, error)

GetObjectFromReferenceOrSelector returns an object referenced by the given reference, or by the selector.

Among the possible errors, TransientError is returned if it's not possible to reply at this point, or AmbiguousReferenceError if more than one object satisfies the selector.

func IsAmbiguousReference

func IsAmbiguousReference(err error) bool

IsAmbiguousReference returns true if an error is ambiguous reference

Types

type Controller

type Controller interface {
	// Run starts the controller and takes ownership of the calling goroutine
	Run(threadiness int, stopCh <-chan struct{}) error
}

Controller is an interface for controllers, allowing them to be run

type Lister

type Lister interface {
	// ListByName returns the object by name
	ListByName(namespace, name string) (runtime.Object, error)
	// ListBySelector returns all the objects satisfying the given selector
	ListBySelector(namespace string, selector labels.Selector) ([]runtime.Object, error)
}

Lister is a capable of listing runtime objects of a certain type.

func NewDeploymentLister

func NewDeploymentLister(ls appslisters.DeploymentLister) Lister

NewDeploymentLister returns a lister for deployments

func NewServiceLister

func NewServiceLister(ls corelisters.ServiceLister) Lister

NewServiceLister returns a lister for deployments

type SharedClient

type SharedClient struct {
	KubeClientset         kubernetes.Interface
	K8ccClientset         clientset.Interface
	KubeInformerFactory   kubeinformers.SharedInformerFactory
	DistccInformerFactory informers.SharedInformerFactory
}

SharedClient provides a shared connection for all operators

func NewSharedClient

func NewSharedClient(masterURL, kubecfg string) (*SharedClient, error)

NewSharedClient creates a new connection to the kubernetes master.

If kubecfg and masterURL are empty, defaults to in-cluster configuration. This should be shared with as many controllers as possible.

func (*SharedClient) Run

func (c *SharedClient) Run(stopCh <-chan struct{}) error

Run starts the client connection, and sync the caches.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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