Documentation ¶
Overview ¶
Package collections implements collection utilities.
Index ¶
- func ActiveMiners(miner *v1beta1.Miner) bool
- func HasControllerRef(miner *v1beta1.Miner) bool
- func HasDeletionTimestamp(miner *v1beta1.Miner) bool
- func HasUnhealthyCondition(miner *v1beta1.Miner) bool
- func OwnedMiners(owner client.Object) func(miner *v1beta1.Miner) bool
- func ToMinerList(miners Miners) v1beta1.MinerList
- type Func
- type Miners
- func (s Miners) AnyFilter(filters ...Func) Miners
- func (s Miners) ConditionGetters() []conditions.Getter
- func (s Miners) DeepCopy() Miners
- func (s Miners) Difference(miners Miners) Miners
- func (s Miners) Filter(filters ...Func) Miners
- func (s Miners) Insert(miners ...*v1beta1.Miner)
- func (s Miners) Len() int
- func (s Miners) LowestVersion() *string
- func (s Miners) Names() []string
- func (s Miners) Newest() *v1beta1.Miner
- func (s Miners) Oldest() *v1beta1.Miner
- func (s Miners) SortedByCreationTimestamp() []*v1beta1.Miner
- func (s Miners) UnsortedList() []*v1beta1.Miner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActiveMiners ¶
ActiveMiners returns a filter to find all active miners. Usage: GetFilteredMinersForCluster(ctx, client, cluster, ActiveMiners).
func HasControllerRef ¶
HasControllerRef is a filter that returns true if the miner has a controller ref.
func HasDeletionTimestamp ¶
HasDeletionTimestamp returns a filter to find all miners that have a deletion timestamp.
func HasUnhealthyCondition ¶
HasUnhealthyCondition returns a filter to find all miners that have a MinerHealthCheckSucceeded condition set to False, indicating a problem was detected on the miner, and the MinerOwnerRemediated condition set, indicating that KCP is responsible of performing remediation as owner of the miner.
func OwnedMiners ¶
OwnedMiners returns a filter to find all miners owned by specified owner. Usage: GetFilteredMinersForCluster(ctx, client, cluster, OwnedMiners(controlPlane)).
func ToMinerList ¶
ToMinerList creates a MinerList from the given Miners.
Types ¶
type Func ¶
Func is the functon definition for a filter.
func HasAnnotationKey ¶
HasAnnotationKey returns a filter to find all miners that have the specified Annotation key present.
func IsReady ¶
func IsReady() Func
IsReady returns a filter to find all miners with the ReadyCondition equals to True.
func ShouldRolloutAfter ¶
ShouldRolloutAfter returns a filter to find all miners where CreationTimestamp < rolloutAfter < reconciliationTIme.
func WithVersion ¶
func WithVersion() Func
WithVersion returns a filter to find miner that have a non empty and valid version.
type Miners ¶
Miners is a set of Miners.
func FromMinerList ¶
FromMinerList creates a Miners from the given MinerList.
func FromMiners ¶
FromMiners creates a Miners from a list of values.
func GetFilteredMinersForMinerSet ¶
func GetFilteredMinersForMinerSet(ctx context.Context, c client.Reader, ms *v1beta1.MinerSet, filters ...Func) (Miners, error)
GetFilteredMinersForMinerSet returns a list of miners that can be filtered or not. If no filter is supplied then all miners associated with the target minerset are returned.
func (Miners) AnyFilter ¶
AnyFilter returns a Miners containing only the Miners that match any of the given MinerFilters.
func (Miners) ConditionGetters ¶
func (s Miners) ConditionGetters() []conditions.Getter
ConditionGetters returns the slice with miners converted into conditions.Getter.
func (Miners) Difference ¶
Difference returns a copy without miners that are in the given collection.
func (Miners) Filter ¶
Filter returns a Miners containing only the Miners that match all of the given MinerFilters.
func (Miners) LowestVersion ¶
LowestVersion returns the lowest version among all the miner with defined versions. If no miner has a defined version it returns an empty string.
func (Miners) Names ¶
Names returns a slice of the names of each miner in the collection. Useful for logging and test assertions.
func (Miners) SortedByCreationTimestamp ¶
SortedByCreationTimestamp returns the miners sorted by creation timestamp.
func (Miners) UnsortedList ¶
UnsortedList returns the slice with contents in random order.