Skip to content

Commit

Permalink
Merge pull request #199 from xiekeyang/rules
Browse files Browse the repository at this point in the history
Remove RuleHasCompleted structure
  • Loading branch information
erwinvaneyk authored Sep 6, 2018
2 parents c5be61b + ff327dd commit 7d5f57a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
5 changes: 4 additions & 1 deletion pkg/controller/invocation/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 0 additions & 11 deletions pkg/controller/invocation/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
}

Expand Down

0 comments on commit 7d5f57a

Please sign in to comment.