Skip to content

Commit

Permalink
fix: try to fix sts process-crashing at init
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Jan 9, 2023
1 parent c1c435a commit a0c82e4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/status/container_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ func TestContainerStatus(status *v1.ContainerStatus, options *config.Options, re
}
case "RunContainerError":
err := MakeRolloutError(FailureProcessCrashing, "Container %q is in %q: %v", status.Name, reason, status.State.Waiting.Message)
return RolloutErrorMaybeProgressing(err)
if ((resourceType == ResourceTypeDeployment || resourceType == ResourceTypeStatefulSet) &&
(status.RestartCount <= options.RetryLimit || options.RetryLimit == -1)) ||
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)
}

case "ErrImagePull":
fallthrough
Expand Down

0 comments on commit a0c82e4

Please sign in to comment.