Documentation ¶
Index ¶
- func AmbiguousReferenceError(err error) error
- func GetObjectFromLabels(lister Lister, namespace string, selector labels.Selector) (runtime.Object, error)
- func GetObjectFromReference(lister Lister, namespace string, ref *corev1.LocalObjectReference) (runtime.Object, error)
- func GetObjectFromReferenceOrSelector(lister Lister, namespace string, ref *corev1.LocalObjectReference, ...) (runtime.Object, error)
- func IsAmbiguousReference(err error) bool
- type Controller
- type Lister
- type SharedClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AmbiguousReferenceError ¶
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 ¶
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 {}
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.