Documentation ¶
Overview ¶
Package conditioner contains conditioner related logic
Index ¶
- type DefaultRunConditionerManager
- func (manger DefaultRunConditionerManager) CalculateRunConditons(ctx context.Context, obj client.Object, list client.ObjectList, ...) ([]RunConditionHandler, error)
- func (manager DefaultRunConditionerManager) GetAffected(ctx context.Context, obj client.Object, list client.ObjectList, ...) (map[v1alpha1.RunConditionerType]client.ObjectList, error)
- type PropertiesHandler
- type RunConditionHandler
- type RunConditioner
- type RunConditionerManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultRunConditionerManager ¶
type DefaultRunConditionerManager struct { }
DefaultRunConditionerManager is default implement for RunConditionerManager
func NewRunConditionManager ¶
func NewRunConditionManager() DefaultRunConditionerManager
NewRunConditionManager initialize DefaultRunConditionManager
func (DefaultRunConditionerManager) CalculateRunConditons ¶
func (manger DefaultRunConditionerManager) CalculateRunConditons(ctx context.Context, obj client.Object, list client.ObjectList, prepare func(client.ObjectList), conditioners []RunConditioner) ([]RunConditionHandler, error)
CalculateRunConditons return all the condition for different runConditioner
func (DefaultRunConditionerManager) GetAffected ¶
func (manager DefaultRunConditionerManager) GetAffected(ctx context.Context, obj client.Object, list client.ObjectList, prepare func(client.ObjectList), conditioners []RunConditioner) (map[v1alpha1.RunConditionerType]client.ObjectList, error)
GetAffected return all affected object base on different runConditioner
type PropertiesHandler ¶
type PropertiesHandler interface { // Config return the configurations Config() string // Compare will compare two RawExtension and check whether they are different and return message users may interest Compare(old *runtime.RawExtension, new *runtime.RawExtension) (changed bool, message string, err error) }
PropertiesHandler knows how to extract configuration and check the different between two properties
type RunConditionHandler ¶
type RunConditionHandler struct { v1alpha1.RunCondition // PropertiesHandler stores the interface that decide how to handle information in properties PropertiesHandler }
RunConditionHandler contains RunCondition and interface to handle properties
type RunConditioner ¶
type RunConditioner interface { // Type return the condtioner type Type() v1alpha1.RunConditionerType // RunCondition return the condition details that indicate the condition status RunCondition(context.Context, client.Object, client.ObjectList) (RunConditionHandler, error) // GetAffected return objects which be affected if the current object completed GetAffected(context.Context, client.Object, client.ObjectList) (client.ObjectList, error) }
RunConditioner indicate the state of the condition
type RunConditionerManager ¶
type RunConditionerManager interface { // CalculateRunConditons return the unsatisfied condition CalculateRunConditons(ctx context.Context, obj client.Object, listrunList client.ObjectList, prepare func(client.ObjectList), conditions []RunConditioner) ([]RunConditionHandler, error) // GetAffected return all the affected objects that need handled after the current object completed GetAffected(ctx context.Context, obj client.Object, list client.ObjectList, prepare func(client.ObjectList), conditions []RunConditioner) (map[v1alpha1.RunConditionerType]client.ObjectList, error) }
RunConditionerManager uesd for answering two questions 1. If run meets all the condition that run can go on 2. If return the left runs that should go on if the run has done CalculateRunConditons answer the first question by returning the unsatisfied condition GetAffected answer the second question by return the runs base on different condition