Skip to content

Commit

Permalink
Fix reqest count (#214)
Browse files Browse the repository at this point in the history
* fix manifest examples

Signed-off-by: YujiOshima <yuji.oshima0x3fd@gmail.com>

* fix MetricsCollector instance

Signed-off-by: YujiOshima <yuji.oshima0x3fd@gmail.com>

* eval req count after status check

Signed-off-by: YujiOshima <yuji.oshima0x3fd@gmail.com>

* fix cont check when ReqestCount is not set

Signed-off-by: YujiOshima <yuji.oshima0x3fd@gmail.com>
  • Loading branch information
YujiOshima authored and k8s-ci-robot committed Oct 17, 2018
1 parent 44bd27e commit 1e14d3c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pkg/controller/studyjobcontroller/studyjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,13 +483,12 @@ func (r *ReconcileStudyJobController) checkStatus(instance *katibv1alpha1.StudyJ
log.Printf("Check Goal failed %v", err)
}
}
if instance.Status.SuggestionCount > 0 && instance.Status.SuggestionCount > instance.Spec.RequestCount {
log.Printf("Study %s reached the request count. It is completed", instance.Status.StudyID)
instance.Status.Condition = katibv1alpha1.ConditionCompleted
update = true
nextSuggestionSchedule = false
}
if nextSuggestionSchedule {
if instance.Spec.RequestCount > 0 && instance.Status.SuggestionCount > instance.Spec.RequestCount {
log.Printf("Study %s reached the request count. It is completed", instance.Status.StudyID)
instance.Status.Condition = katibv1alpha1.ConditionCompleted
return true, nil
}
return r.getAndRunSuggestion(instance, c, ns)
} else {
return update, nil
Expand Down

0 comments on commit 1e14d3c

Please sign in to comment.