Documentation ¶
Overview ¶
Package hierarchy provides tools to discover a resource hierarchy. A resource hierarchy is made when a resource has a set of rules to discover other resources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type KeySelector ¶
type KeySelector struct {
Namespace, Name string
}
KeySelector is used for discovering a single object based on namespace and name.
func (*KeySelector) ApplyToList ¶
func (ks *KeySelector) ApplyToList(lo *client.ListOptions)
ApplyToList implements Selector.
type LabelsSelector ¶
type LabelsSelector struct { // NamespaceName is the default namespace to search for objects in when // NamespaceSelector is nil. NamespaceName string // NamespaceLabels causes all namespaces whose labels match NamespaceLabels // to be searched. When nil, only the namespace specified by NamespaceName // will be searched. NamespaceLabels labels.Selector // Labels discovers all objects whose labels match the selector. If nil, // no objects will be discovered. Labels labels.Selector }
LabelsSelector is used for discovering a set of objects in a hierarchy based on labels.
func (*LabelsSelector) ApplyToList ¶
func (ls *LabelsSelector) ApplyToList(lo *client.ListOptions)
ApplyToList implements Selector.
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier can be attached to a controller and generate reconciles when objects inside of a resource hierarchy change.
func NewNotifier ¶
NewNotifier creates a new Notifier which uses the provided client for performing hierarchy lookups.
func (*Notifier) EventHandler ¶
func (n *Notifier) EventHandler() handler.EventHandler
EventHandler returns an event handler that can be given to controller.Watches.
controller.Watches should be called once per type in the resource hierarchy. Each call to controller.Watches should use the same Notifier.
func (*Notifier) Notify ¶
Notify configures reconciles to be generated for a set of watchers when watched resources change.
Notify appends to the list of watchers. To remove out notifications for a specific owner, call StopNotify.
func (*Notifier) StopNotify ¶
StopNotify removes all watches for a specific owner.
type Selector ¶
type Selector interface { // ListOption can be passed to List to perform initial filtering of returned // objects. client.ListOption // Matches returns true if the Selector matches the provided Object. The // provided Client may be used to perform extra searches. Matches(context.Context, client.Client, client.Object) (bool, error) }
Selector finding objects within the resource hierarchy.