Skip to content

Commit

Permalink
fix: process-crashing retry error
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Jan 13, 2023
1 parent a0c82e4 commit 1d6cf85
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/status/container_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func TestContainerStatus(status *v1.ContainerStatus, options *config.Options, re
resourceType == ResourceTypeJob {
return RolloutErrorProgressing(err)
} else {
err := MakeRolloutError(FailureProcessCrashing, "Container %q is in %q: %v", status.Name, reason, status.State.Waiting.Message)
return RolloutErrorMaybeProgressing(err)
}

Expand All @@ -60,7 +59,13 @@ func TestContainerStatus(status *v1.ContainerStatus, options *config.Options, re
switch reason {
case "Error":
err := MakeRolloutError(FailureProcessCrashing, "Container %q is in %q", status.Name, reason)
return RolloutErrorMaybeProgressing(err)
if ((resourceType == ResourceTypeDeployment || resourceType == ResourceTypeStatefulSet) &&
(status.RestartCount <= options.RetryLimit || options.RetryLimit == -1)) ||
resourceType == ResourceTypeJob {
return RolloutErrorProgressing(err)
} else {
return RolloutErrorMaybeProgressing(err)
}
case "OOMKilled":
err := MakeRolloutError(FailureResourceLimitsExceeded, "Container %q is in %q", status.Name, reason)
return RolloutFatal(err)
Expand Down

0 comments on commit 1d6cf85

Please sign in to comment.