Skip to content

Commit

Permalink
Merge pull request #338 from werf/fix-low-level-success-status-priori…
Browse files Browse the repository at this point in the history
…tized-over-failure-2

fix(readiness): prioritize forced success status over failure /2
  • Loading branch information
ilya-lesikov authored Feb 28, 2024
2 parents 72817a7 + 4d52ab2 commit 7dddbbb
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pkg/trackers/dyntracker/dynamic_readiness_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -985,14 +985,14 @@ func (t *DynamicReadinessTracker) handleDeploymentStatus(status *deployment.Depl
rs.SetStatus(statestore.ResourceStatusReady)
})
}

return
}

if status.IsFailed {
taskState.ResourceState(taskState.Name(), taskState.Namespace(), taskState.GroupVersionKind()).RWTransaction(func(rs *statestore.ResourceState) {
rs.AddError(errors.New(status.FailedReason), "", time.Now())
})

return
}
}

Expand All @@ -1011,14 +1011,14 @@ func (t *DynamicReadinessTracker) handleStatefulSetStatus(status *statefulset.St
rs.SetStatus(statestore.ResourceStatusReady)
})
}

return
}

if status.IsFailed {
taskState.ResourceState(taskState.Name(), taskState.Namespace(), taskState.GroupVersionKind()).RWTransaction(func(rs *statestore.ResourceState) {
rs.AddError(errors.New(status.FailedReason), "", time.Now())
})

return
}
}

Expand All @@ -1037,14 +1037,14 @@ func (t *DynamicReadinessTracker) handleDaemonSetStatus(status *daemonset.Daemon
rs.SetStatus(statestore.ResourceStatusReady)
})
}

return
}

if status.IsFailed {
taskState.ResourceState(taskState.Name(), taskState.Namespace(), taskState.GroupVersionKind()).RWTransaction(func(rs *statestore.ResourceState) {
rs.AddError(errors.New(status.FailedReason), "", time.Now())
})

return
}
}

Expand All @@ -1061,14 +1061,14 @@ func (t *DynamicReadinessTracker) handleJobStatus(status *job.JobStatus, taskSta
rs.SetStatus(statestore.ResourceStatusReady)
})
}

return
}

if status.IsFailed {
taskState.ResourceState(taskState.Name(), taskState.Namespace(), taskState.GroupVersionKind()).RWTransaction(func(rs *statestore.ResourceState) {
rs.AddError(errors.New(status.FailedReason), "", time.Now())
})

return
}
}

Expand All @@ -1081,14 +1081,14 @@ func (t *DynamicReadinessTracker) handleCanaryStatus(status *canary.CanaryStatus
rs.SetStatus(statestore.ResourceStatusReady)
})
}

return
}

if status.IsFailed {
taskState.ResourceState(taskState.Name(), taskState.Namespace(), taskState.GroupVersionKind()).RWTransaction(func(rs *statestore.ResourceState) {
rs.AddError(errors.New(status.FailedReason), "", time.Now())
})

return
}
}

Expand Down

0 comments on commit 7dddbbb

Please sign in to comment.