var ( ApiVersion = v1alpha1.GroupVersion.String() KindWorkflow = "Workflow" KindWorkflowNode = "WorkflowNode" )
func BootstrapWorkflowControllers(mgr manager.Manager, logger logr.Logger, recorderBuilder *recorder.RecorderBuilder) error
func ConditionEqualsTo(status v1alpha1.WorkflowNodeStatus, conditionType v1alpha1.WorkflowNodeConditionType, expected corev1.ConditionStatus) bool
func GetCondition(status v1alpha1.WorkflowNodeStatus, conditionType v1alpha1.WorkflowNodeConditionType) *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, expected corev1.ConditionStatus) bool
func WorkflowNodeFinished(status v1alpha1.WorkflowNodeStatus) bool
type AbortNodeReconciler struct { *ChildNodesFetcher // contains filtered or unexported fields }
func NewAbortNodeReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *AbortNodeReconciler
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 struct { *ChildNodesFetcher // contains filtered or unexported fields }
func NewAbortWorkflowReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *AbortWorkflowReconciler
func (it *AbortWorkflowReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)
Reconcile watches `Workflows`, if the workflow has the abort annotation, it will set the abort condition of the `entry node` to `True`.
type ChaosNodeReconciler struct {
// contains filtered or unexported fields
}
func NewChaosNodeReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *ChaosNodeReconciler
func (it *ChaosNodeReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)
type ChildNodesFetcher struct {
// contains filtered or unexported fields
}
func NewChildNodesFetcher(kubeClient client.Client, logger logr.Logger) *ChildNodesFetcher
type DeadlineReconciler struct { *ChildNodesFetcher // contains filtered or unexported fields }
func NewDeadlineReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *DeadlineReconciler
func (it *DeadlineReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)
ParallelNodeReconciler watches on nodes which type is Parallel
type ParallelNodeReconciler struct { *ChildNodesFetcher // contains filtered or unexported fields }
func NewParallelNodeReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *ParallelNodeReconciler
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
SerialNodeReconciler watches on nodes which type is Serial
type SerialNodeReconciler struct { *ChildNodesFetcher // contains filtered or unexported fields }
func NewSerialNodeReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *SerialNodeReconciler
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 []v1alpha1.WorkflowNode
func (it SortByCreationTimestamp) Len() int
func (it SortByCreationTimestamp) Less(i, j int) bool
func (it SortByCreationTimestamp) Swap(i, j int)
type SortGenericChaosByCreationTimestamp []v1alpha1.GenericChaos
func (it SortGenericChaosByCreationTimestamp) Len() int
func (it SortGenericChaosByCreationTimestamp) Less(i, j int) bool
func (it SortGenericChaosByCreationTimestamp) Swap(i, j int)
type SortScheduleByCreationTimestamp []v1alpha1.Schedule
func (it SortScheduleByCreationTimestamp) Len() int
func (it SortScheduleByCreationTimestamp) Less(i, j int) bool
func (it SortScheduleByCreationTimestamp) Swap(i, j int)
type StatusCheckReconciler struct {
// contains filtered or unexported fields
}
func NewStatusCheckReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *StatusCheckReconciler
func (it *StatusCheckReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)
type TaskReconciler struct { *ChildNodesFetcher // contains filtered or unexported fields }
func NewTaskReconciler(kubeClient client.Client, restConfig *rest.Config, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *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)
WorkflowEntryReconciler watches on Workflow, creates new Entry Node for created Workflow.
type WorkflowEntryReconciler struct {
// contains filtered or unexported fields
}
func NewWorkflowEntryReconciler(kubeClient client.Client, eventRecorder recorder.ChaosRecorder, logger logr.Logger) *WorkflowEntryReconciler
func (it *WorkflowEntryReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)