From ff327dd44944abf8d807e21be6e4f4a9ef8a652e Mon Sep 17 00:00:00 2001 From: xiekeyang Date: Wed, 5 Sep 2018 18:19:06 +0800 Subject: [PATCH] Remove RuleHasCompleted structure This seems not to bring any valid action. --- pkg/controller/invocation/controller.go | 5 ++++- pkg/controller/invocation/rules.go | 11 ----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/pkg/controller/invocation/controller.go b/pkg/controller/invocation/controller.go index ba4fb722..b60c8578 100644 --- a/pkg/controller/invocation/controller.go +++ b/pkg/controller/invocation/controller.go @@ -382,17 +382,20 @@ func defaultPolicy(ctr *Controller) controller.Rule { }, Timeout: time.Duration(10) * time.Minute, }, + &controller.RuleExceededErrorCount{ OnExceeded: &ActionFail{ API: ctr.invocationAPI, }, MaxErrorCount: 0, }, - &RuleHasCompleted{}, + &RuleCheckIfCompleted{ InvocationAPI: ctr.invocationAPI, }, + &RuleWorkflowIsReady{}, + &RuleSchedule{ Scheduler: ctr.scheduler, InvocationAPI: ctr.invocationAPI, diff --git a/pkg/controller/invocation/rules.go b/pkg/controller/invocation/rules.go index 1bcb11be..7df9867d 100644 --- a/pkg/controller/invocation/rules.go +++ b/pkg/controller/invocation/rules.go @@ -44,17 +44,6 @@ func (ec WfiEvalContext) Invocation() *types.WorkflowInvocation { return ec.wfi } -type RuleHasCompleted struct{} - -func (cf *RuleHasCompleted) Eval(cec controller.EvalContext) controller.Action { - ec := EnsureInvocationContext(cec) - wfi := ec.Invocation() - if wfi.Status.Finished() { - log.Infof("No need to evaluate finished invocation %v", wfi.Metadata.Id) - } - return nil -} - type RuleWorkflowIsReady struct { }