Documentation ¶
Index ¶
- func RegisterEvaluatorConstructor(strat conf.Strategy, con EvaluatorConstructor) error
- func SortCreationTimestampAsc(pods []v1.Pod) []v1.Pod
- type Evaluator
- func ApplyFilter(filter Filter) Evaluator
- func CoolDown(cd time.Duration, eval Evaluator) Evaluator
- func EvaluatorSeive(evaluators ...Evaluator) Evaluator
- func FilterPodSet(filterSet []v1.Pod) Evaluator
- func Limit(limit int64) Evaluator
- func OlderThan(maxAge time.Duration) Evaluator
- func Spread(maxAge time.Duration, eval Evaluator) Evaluator
- func SpreadFast(maxAge time.Duration, limit int64, eval Evaluator) Evaluator
- type EvaluatorConstructor
- type Filter
- type Strategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterEvaluatorConstructor ¶
func RegisterEvaluatorConstructor(strat conf.Strategy, con EvaluatorConstructor) error
RegisterEvaluatorConstructor registers an EvaluatorConstructor for use with a given name. This can then be referenced from a conf.Criteria.Strategy for use.
Types ¶
type Evaluator ¶
Evaluator is the logic kernel used to evaluate kicking a set of pods
func ApplyFilter ¶
ApplyFilter returns a eval that filters a set of v1.Pods and returns a new slice of pods that match the filter.
func EvaluatorSeive ¶
func FilterPodSet ¶
type EvaluatorConstructor ¶
EvaluatorConstructor defines a constructor function for an Evaluator
func RetrieveEvaluatorConstructor ¶
func RetrieveEvaluatorConstructor(strat conf.Strategy) (EvaluatorConstructor, error)
RetrieveEvaluatorConstructor retrieves a registered EvaluatorConstructor.
type Filter ¶
Filter provides the core concept of a simple set of functional filters to be used as a convenience for defining your own strategies
func And ¶
And groups a set of filters into a single filter where all grouped filters must pass for it to pass. This takes advantage of early exit so ensure you place your least likely to match values in front to optimize the filter.
func NamePrefixFilter ¶
NamePrefixFilter matches when the passed v1.Pod.Name has the passed prefix
func NameSpaceFilter ¶
NameSpaceFilter matches when the passed v1.Pod.Namespace is equivalent to the passed namespace
func Or ¶
Or groups a set of filters into a single filter where at least one grouped filter must pass for it to pass. This takes advantage of early exit so ensure you place your most likely to match values in front to optimize the filter.
func StatusFilter ¶
StatusFilter matches when the passed v1.Pod.Status.Phase is equivalent to the passed Status
type Strategy ¶
type Strategy struct {
// contains filtered or unexported fields
}
Strategy is an object used to statefully evaluate a set of v1.Pod for to be kicked
func NewStrategy ¶
NewStrategy builds and returns a new Strategy for the provided conf.Criteria, returning an error if unable to do so.