Documentation
¶
Index ¶
- Variables
- func BootstrapWorkflowControllers(mgr manager.Manager, logger logr.Logger, ...) error
- func ConditionEqualsTo(status v1alpha1.WorkflowNodeStatus, ...) bool
- func GetCondition(status v1alpha1.WorkflowNodeStatus, ...) *v1alpha1.WorkflowNodeCondition
- func GetWorkflowCondition(status v1alpha1.WorkflowStatus, conditionType v1alpha1.WorkflowConditionType) *v1alpha1.WorkflowCondition
- func SetCondition(status *v1alpha1.WorkflowNodeStatus, condition v1alpha1.WorkflowNodeCondition)
- func SetWorkflowCondition(status *v1alpha1.WorkflowStatus, condition v1alpha1.WorkflowCondition)
- func WorkflowAborted(workflow v1alpha1.Workflow) bool
- func WorkflowConditionEqualsTo(status v1alpha1.WorkflowStatus, conditionType v1alpha1.WorkflowConditionType, ...) bool
- func WorkflowNodeFinished(status v1alpha1.WorkflowNodeStatus) bool
- type AbortNodeReconciler
- type AbortWorkflowReconciler
- type ChaosNodeReconciler
- type ChildNodesFetcher
- type DeadlineReconciler
- type ParallelNodeReconciler
- type SerialNodeReconciler
- type SortByCreationTimestamp
- type SortGenericChaosByCreationTimestamp
- type SortScheduleByCreationTimestamp
- type StatusCheckReconciler
- type TaskReconciler
- func (it *TaskReconciler) FetchPodControlledByThisWorkflowNode(ctx context.Context, node v1alpha1.WorkflowNode) ([]corev1.Pod, error)
- func (it *TaskReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)
- func (it *TaskReconciler) SpawnTaskPod(ctx context.Context, node *v1alpha1.WorkflowNode, workflow *v1alpha1.Workflow) (*corev1.Pod, error)
- type WorkflowEntryReconciler
Constants ¶
This section is empty.
Variables ¶
var ( ApiVersion = v1alpha1.GroupVersion.String() KindWorkflow = "Workflow" KindWorkflowNode = "WorkflowNode" )
Functions ¶
func ConditionEqualsTo ¶
func ConditionEqualsTo(status v1alpha1.WorkflowNodeStatus, conditionType v1alpha1.WorkflowNodeConditionType, expected corev1.ConditionStatus) bool
func GetCondition ¶
func GetCondition(status v1alpha1.WorkflowNodeStatus, conditionType v1alpha1.WorkflowNodeConditionType) *v1alpha1.WorkflowNodeCondition
func GetWorkflowCondition ¶
func GetWorkflowCondition(status v1alpha1.WorkflowStatus, conditionType v1alpha1.WorkflowConditionType) *v1alpha1.WorkflowCondition
func SetCondition ¶
func SetCondition(status *v1alpha1.WorkflowNodeStatus, condition v1alpha1.WorkflowNodeCondition)
func SetWorkflowCondition ¶
func SetWorkflowCondition(status *v1alpha1.WorkflowStatus, condition v1alpha1.WorkflowCondition)
func WorkflowAborted ¶
func WorkflowConditionEqualsTo ¶
func WorkflowConditionEqualsTo(status v1alpha1.WorkflowStatus, conditionType v1alpha1.WorkflowConditionType, expected corev1.ConditionStatus) bool
func WorkflowNodeFinished ¶
func WorkflowNodeFinished(status v1alpha1.WorkflowNodeStatus) bool
Types ¶
type AbortNodeReconciler ¶
type AbortNodeReconciler struct { *ChildNodesFetcher // contains filtered or unexported fields }
func NewAbortNodeReconciler ¶
func NewAbortNodeReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *AbortNodeReconciler
func (*AbortNodeReconciler) Reconcile ¶
func (it *AbortNodeReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)
Reconcile watches `WorkflowNodes`, if: 1. the abort condition is `False`, just return. 2. the abort condition is `True`, the node is not `TypeStatusCheck`, it will propagate abort condition to children nodes. 3. the abort condition is `True`, the node is `TypeStatusCheck`, it will add abort annotation to the parent workflow.
type AbortWorkflowReconciler ¶
type AbortWorkflowReconciler struct { *ChildNodesFetcher // contains filtered or unexported fields }
func NewAbortWorkflowReconciler ¶
func NewAbortWorkflowReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *AbortWorkflowReconciler
type ChaosNodeReconciler ¶
type ChaosNodeReconciler struct {
// contains filtered or unexported fields
}
func NewChaosNodeReconciler ¶
func NewChaosNodeReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *ChaosNodeReconciler
type ChildNodesFetcher ¶
type ChildNodesFetcher struct {
// contains filtered or unexported fields
}
func NewChildNodesFetcher ¶
func NewChildNodesFetcher(kubeClient client.Client, logger logr.Logger) *ChildNodesFetcher
type DeadlineReconciler ¶
type DeadlineReconciler struct { *ChildNodesFetcher // contains filtered or unexported fields }
func NewDeadlineReconciler ¶
func NewDeadlineReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *DeadlineReconciler
type ParallelNodeReconciler ¶
type ParallelNodeReconciler struct { *ChildNodesFetcher // contains filtered or unexported fields }
ParallelNodeReconciler watches on nodes which type is Parallel
func NewParallelNodeReconciler ¶
func NewParallelNodeReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *ParallelNodeReconciler
func (*ParallelNodeReconciler) Reconcile ¶
func (it *ParallelNodeReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)
Reconcile is extremely like the one in SerialNodeReconciler, only allows the parallel schedule, and respawn **all** the children tasks during retry
type SerialNodeReconciler ¶
type SerialNodeReconciler struct { *ChildNodesFetcher // contains filtered or unexported fields }
SerialNodeReconciler watches on nodes which type is Serial
func NewSerialNodeReconciler ¶
func NewSerialNodeReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *SerialNodeReconciler
func (*SerialNodeReconciler) Reconcile ¶
func (it *SerialNodeReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)
Reconcile should be invoked by: changes on a serial node, or changes on a node which controlled by serial node. So we need to setup EnqueueRequestForOwner while setting up this reconciler.
Reconcile does these things: 1. walk through on tasks in spec, compare them with the node instances (listed with v1alpha1.LabelControlledBy), remove the outdated instance; 2. find out the node needs to be created, then create one if exists; 3. update the status of serial node;
In this reconciler, we SHOULD NOT use v1alpha1.WorkflowNodeStatus as the state. Because v1alpha1.WorkflowNodeStatus is generated by this reconciler, if that itself also depends on that state, it will be complex to decide when to update the status, and even require to update status more than one time, that sounds not good. And We MUST update v1alpha1.WorkflowNodeStatus by "observing real world" at EACH TIME, such as listing controlled children nodes. We only update v1alpha1.WorkflowNodeStatus once(wrapped with retry on conflict), at the end of this method.
type SortByCreationTimestamp ¶
type SortByCreationTimestamp []v1alpha1.WorkflowNode
func (SortByCreationTimestamp) Len ¶
func (it SortByCreationTimestamp) Len() int
func (SortByCreationTimestamp) Less ¶
func (it SortByCreationTimestamp) Less(i, j int) bool
func (SortByCreationTimestamp) Swap ¶
func (it SortByCreationTimestamp) Swap(i, j int)
type SortGenericChaosByCreationTimestamp ¶
type SortGenericChaosByCreationTimestamp []v1alpha1.GenericChaos
func (SortGenericChaosByCreationTimestamp) Len ¶
func (it SortGenericChaosByCreationTimestamp) Len() int
func (SortGenericChaosByCreationTimestamp) Less ¶
func (it SortGenericChaosByCreationTimestamp) Less(i, j int) bool
func (SortGenericChaosByCreationTimestamp) Swap ¶
func (it SortGenericChaosByCreationTimestamp) Swap(i, j int)
type SortScheduleByCreationTimestamp ¶
func (SortScheduleByCreationTimestamp) Len ¶
func (it SortScheduleByCreationTimestamp) Len() int
func (SortScheduleByCreationTimestamp) Less ¶
func (it SortScheduleByCreationTimestamp) Less(i, j int) bool
func (SortScheduleByCreationTimestamp) Swap ¶
func (it SortScheduleByCreationTimestamp) Swap(i, j int)
type StatusCheckReconciler ¶
type StatusCheckReconciler struct {
// contains filtered or unexported fields
}
func NewStatusCheckReconciler ¶
func NewStatusCheckReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *StatusCheckReconciler
type TaskReconciler ¶
type TaskReconciler struct { *ChildNodesFetcher // contains filtered or unexported fields }
func NewTaskReconciler ¶
func NewTaskReconciler(kubeClient client.Client, restConfig *rest.Config, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *TaskReconciler
func (*TaskReconciler) FetchPodControlledByThisWorkflowNode ¶
func (it *TaskReconciler) FetchPodControlledByThisWorkflowNode(ctx context.Context, node v1alpha1.WorkflowNode) ([]corev1.Pod, error)
func (*TaskReconciler) SpawnTaskPod ¶
func (it *TaskReconciler) SpawnTaskPod(ctx context.Context, node *v1alpha1.WorkflowNode, workflow *v1alpha1.Workflow) (*corev1.Pod, error)
type WorkflowEntryReconciler ¶
type WorkflowEntryReconciler struct {
// contains filtered or unexported fields
}
WorkflowEntryReconciler watches on Workflow, creates new Entry Node for created Workflow.
func NewWorkflowEntryReconciler ¶
func NewWorkflowEntryReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *WorkflowEntryReconciler