Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Skip condition update when succeeded #173

Merged
merged 1 commit into from
Jun 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/controller.v1/pytorch/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ func isFailed(status common.JobStatus) bool {
// If the condition that we are about to add already exists
// and has the same status and reason then we are not going to update.
func setCondition(status *common.JobStatus, condition common.JobCondition) {
// Do nothing if PyTorchJobStatus have failed condition
if isFailed(*status) {
// Do nothing if PyTorchJobStatus is completed
if isFailed(*status) || isSucceeded(*status) {
return
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/controller.v1beta2/pytorch/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ func isFailed(status common.JobStatus) bool {
// If the condition that we are about to add already exists
// and has the same status and reason then we are not going to update.
func setCondition(status *common.JobStatus, condition common.JobCondition) {
// Do nothing if PyTorchJobStatus have failed condition
if isFailed(*status) {
// Do nothing if PyTorchJobStatus is completed
if isFailed(*status) || isSucceeded(*status) {
return
}

Expand Down