Documentation ¶
Overview ¶
Package collections implements collection utilities.
Index ¶
- func ActiveKKInstances(kkInstance *infrav1.KKInstance) bool
- func ControlPlaneKKInstances(clusterName string) func(kkInstance *infrav1.KKInstance) bool
- func ControlPlaneSelectorForCluster(clusterName string) labels.Selector
- func OwnedKKInstances(owner client.Object) func(kkInstance *infrav1.KKInstance) bool
- func ToKKInstanceList(kkInstances KKInstances) infrav1.KKInstanceList
- type Func
- type KKInstances
- func FromKKInstanceList(kkInstanceList *infrav1.KKInstanceList) KKInstances
- func FromKKInstances(kkInstances ...*infrav1.KKInstance) KKInstances
- func GetFilteredKKInstancesForKKCluster(ctx context.Context, c client.Reader, kkCluster *infrav1.KKCluster, ...) (KKInstances, error)
- func New() KKInstances
- func (s KKInstances) AnyFilter(filters ...Func) KKInstances
- func (s KKInstances) ConditionGetters() []conditions.Getter
- func (s KKInstances) DeepCopy() KKInstances
- func (s KKInstances) Difference(kkInstances KKInstances) KKInstances
- func (s KKInstances) Filter(filters ...Func) KKInstances
- func (s KKInstances) Insert(kkInstances ...*infrav1.KKInstance)
- func (s KKInstances) Len() int
- func (s KKInstances) Names() []string
- func (s KKInstances) Newest() *infrav1.KKInstance
- func (s KKInstances) Oldest() *infrav1.KKInstance
- func (s KKInstances) SortedByCreationTimestamp() []*infrav1.KKInstance
- func (s KKInstances) UnsortedList() []*infrav1.KKInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActiveKKInstances ¶
func ActiveKKInstances(kkInstance *infrav1.KKInstance) bool
ActiveKKInstances returns a filter to find all active kkinstances. Usage: GetFilteredKKInstancesForKKCluster(ctx, client, cluster, ActiveKKInstances).
func ControlPlaneKKInstances ¶
func ControlPlaneKKInstances(clusterName string) func(kkInstance *infrav1.KKInstance) bool
ControlPlaneKKInstances returns a filter to find all control plane KKInstance for a cluster, regardless of ownership. Usage: GetFilteredKKInstancesForKKCluster(ctx, client, cluster, ControlPlaneKKInstances(cluster.Name)).
func ControlPlaneSelectorForCluster ¶
ControlPlaneSelectorForCluster returns the label selector necessary to get control plane KKInstance for a given cluster.
func OwnedKKInstances ¶
func OwnedKKInstances(owner client.Object) func(kkInstance *infrav1.KKInstance) bool
OwnedKKInstances returns a filter to find all kkInstances owned by specified owner. Usage: GetFilteredKKInstancesForKKCluster(ctx, client, cluster, OwnedKKInstances(controlPlane)).
func ToKKInstanceList ¶
func ToKKInstanceList(kkInstances KKInstances) infrav1.KKInstanceList
ToKKInstanceList creates a KKInstanceList from the given KKInstances.
Types ¶
type Func ¶
type Func func(kkInstance *infrav1.KKInstance) bool
Func is the functon definition for a filter.
type KKInstances ¶
type KKInstances map[string]*infrav1.KKInstance
KKInstances is a set of KKInstances.
func FromKKInstanceList ¶
func FromKKInstanceList(kkInstanceList *infrav1.KKInstanceList) KKInstances
FromKKInstanceList creates a KKInstances from the given KKInstanceList.
func FromKKInstances ¶
func FromKKInstances(kkInstances ...*infrav1.KKInstance) KKInstances
FromKKInstances creates a KKInstance from a list of values.
func GetFilteredKKInstancesForKKCluster ¶
func GetFilteredKKInstancesForKKCluster(ctx context.Context, c client.Reader, kkCluster *infrav1.KKCluster, filters ...Func) (KKInstances, error)
GetFilteredKKInstancesForKKCluster returns a list of kkInstances that can be filtered or not. If no filter is supplied then all kkInstances associated with the target kkCluster are returned.
func (KKInstances) AnyFilter ¶
func (s KKInstances) AnyFilter(filters ...Func) KKInstances
AnyFilter returns a KKInstances containing only the KKInstances that match any of the given KKInstanceFilters.
func (KKInstances) ConditionGetters ¶
func (s KKInstances) ConditionGetters() []conditions.Getter
ConditionGetters returns the slice with KKInstances converted into conditions.Getter.
func (KKInstances) DeepCopy ¶
func (s KKInstances) DeepCopy() KKInstances
DeepCopy returns a deep copy.
func (KKInstances) Difference ¶
func (s KKInstances) Difference(kkInstances KKInstances) KKInstances
Difference returns a copy without KKInstances that are in the given collection.
func (KKInstances) Filter ¶
func (s KKInstances) Filter(filters ...Func) KKInstances
Filter returns a KKInstances containing only the KKInstances that match all of the given KKInstanceFilters.
func (KKInstances) Insert ¶
func (s KKInstances) Insert(kkInstances ...*infrav1.KKInstance)
Insert adds items to the set.
func (KKInstances) Names ¶
func (s KKInstances) Names() []string
Names returns a slice of the names of each KKInstance in the collection. Useful for logging and test assertions.
func (KKInstances) Newest ¶
func (s KKInstances) Newest() *infrav1.KKInstance
Newest returns the KKInstance with the most recent CreationTimestamp.
func (KKInstances) Oldest ¶
func (s KKInstances) Oldest() *infrav1.KKInstance
Oldest returns the KKInstances with the oldest CreationTimestamp.
func (KKInstances) SortedByCreationTimestamp ¶
func (s KKInstances) SortedByCreationTimestamp() []*infrav1.KKInstance
SortedByCreationTimestamp returns the KKInstances sorted by creation timestamp.
func (KKInstances) UnsortedList ¶
func (s KKInstances) UnsortedList() []*infrav1.KKInstance
UnsortedList returns the slice with contents in random order.