Skip to content

Commit

Permalink
fix studyJob status suggestionCount mismatch error (#290)
Browse files Browse the repository at this point in the history
Fixes: #289
  • Loading branch information
hougangliu authored and k8s-ci-robot committed Dec 14, 2018
1 parent 41e8f7d commit 5a7977d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion pkg/controller/studyjob/katib_api_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func initializeStudy(instance *katibv1alpha1.StudyJob, ns string) error {
return err
}
instance.Status.SuggestionParameterID = sPID
instance.Status.SuggestionCount += 1
instance.Status.Condition = katibv1alpha1.ConditionRunning
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/studyjob/studyjob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ func (r *ReconcileStudyJobController) checkStatus(instance *katibv1alpha1.StudyJ
}
}
if nextSuggestionSchedule {
if instance.Spec.RequestCount > 0 && instance.Status.SuggestionCount > instance.Spec.RequestCount {
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
now := metav1.Now()
Expand Down

0 comments on commit 5a7977d

Please sign in to comment.