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

Commit 999c6ca

Browse files
johnugeorgek8s-ci-robot
authored andcommitted
Skip condition update when succeeded (#173)
1 parent 6d30f84 commit 999c6ca

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/controller.v1/pytorch/status.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ func isFailed(status common.JobStatus) bool {
203203
// If the condition that we are about to add already exists
204204
// and has the same status and reason then we are not going to update.
205205
func setCondition(status *common.JobStatus, condition common.JobCondition) {
206-
// Do nothing if PyTorchJobStatus have failed condition
207-
if isFailed(*status) {
206+
// Do nothing if PyTorchJobStatus is completed
207+
if isFailed(*status) || isSucceeded(*status) {
208208
return
209209
}
210210

pkg/controller.v1beta2/pytorch/status.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ func isFailed(status common.JobStatus) bool {
203203
// If the condition that we are about to add already exists
204204
// and has the same status and reason then we are not going to update.
205205
func setCondition(status *common.JobStatus, condition common.JobCondition) {
206-
// Do nothing if PyTorchJobStatus have failed condition
207-
if isFailed(*status) {
206+
// Do nothing if PyTorchJobStatus is completed
207+
if isFailed(*status) || isSucceeded(*status) {
208208
return
209209
}
210210

0 commit comments

Comments
 (0)