Documentation ¶
Index ¶
- Constants
- func OperatorNames(labels map[string]string) (names []types.NamespacedName)
- type Component
- type Operator
- func (o *Operator) AddComponents(components ...runtime.Object) error
- func (o *Operator) AdoptComponent(component runtime.Object) (adopted bool, err error)
- func (o *Operator) ComponentLabelKey() (string, error)
- func (o *Operator) ComponentLabelSelector() (*metav1.LabelSelector, error)
- func (o *Operator) ComponentSelector() (labels.Selector, error)
- func (o *Operator) DisownComponent(component runtime.Object) (disowned bool, err error)
- func (o *Operator) NonComponentLabelSelector() (*metav1.LabelSelector, error)
- func (o *Operator) NonComponentSelector() (labels.Selector, error)
- func (o *Operator) ResetComponents() error
- func (o *Operator) SetComponents(components ...runtime.Object) error
- type OperatorFactory
Constants ¶
const (
// ComponentLabelKeyPrefix is the key prefix used for labels marking operator component resources.
ComponentLabelKeyPrefix = "operators.coreos.com/"
)
Variables ¶
This section is empty.
Functions ¶
func OperatorNames ¶
func OperatorNames(labels map[string]string) (names []types.NamespacedName)
OperatorNames returns a list of operator names extracted from the given labels.
Types ¶
type Component ¶
type Component struct { *unstructured.Unstructured // contains filtered or unexported fields }
func NewComponent ¶
NewComponent returns a new Component instance.
func (*Component) Reference ¶
func (c *Component) Reference() (ref *operatorsv1.RichReference, err error)
type Operator ¶
type Operator struct { *operatorsv1.Operator // contains filtered or unexported fields }
Operator decorates an external Operator and provides convenience methods for managing it.
func (*Operator) AddComponents ¶
AddComponents adds the given components to the operator's status and returns an error if a component isn't associated with the operator by label. List type arguments are flattened to their nested elements before being added.
func (*Operator) AdoptComponent ¶
AdoptComponent adds the operator's component label to the given component, returning true if the component label was added and false if it already existed.
func (*Operator) ComponentLabelKey ¶
ComponentLabelKey returns the operator's completed component label key.
func (*Operator) ComponentLabelSelector ¶
func (o *Operator) ComponentLabelSelector() (*metav1.LabelSelector, error)
ComponentLabelSelector returns a LabelSelector that matches this operator's component label.
func (*Operator) ComponentSelector ¶
ComponentSelector returns a Selector that matches this operator's component label.
func (*Operator) DisownComponent ¶
DisownComponent removes the operator's component label from the given component, returning true if the component label was removed and false if it wasn't present.
func (*Operator) NonComponentLabelSelector ¶
func (o *Operator) NonComponentLabelSelector() (*metav1.LabelSelector, error)
NonComponentLabelSelector returns a LabelSelector that matches resources that do not have this operator's component label.
func (*Operator) NonComponentSelector ¶
NonComponentSelector returns a Selector that matches resources that do not have this operator's component label.
func (*Operator) ResetComponents ¶
ResetComponents resets the component selector and references in the operator's status.
type OperatorFactory ¶
type OperatorFactory interface { // NewOperator returns an Operator decorator that wraps the given external Operator representation. // An error is returned if the decorator cannon be instantiated. NewOperator(external *operatorsv1.Operator) (*Operator, error) // NewPackageOperator returns an Operator decorator for a package and install namespace. NewPackageOperator(pkg, namespace string) (*Operator, error) }
func NewSchemedOperatorFactory ¶
func NewSchemedOperatorFactory(scheme *runtime.Scheme) (OperatorFactory, error)
NewSchemedOperatorFactory returns an OperatorFactory that supplies a scheme to all Operators it creates.