Skip to content

Commit

Permalink
Bug 1857821: Fix for pod ring exception
Browse files Browse the repository at this point in the history
Backporting fix in 4.6 for pod ring exception caused by lack of handling for a bad length on a failed pods variable in getFailedPods.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1857821
  • Loading branch information
rebeccaalpert committed Jul 17, 2020
1 parent c2223af commit 853031f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/packages/console-shared/src/utils/pod-ring-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ const isPendingPods = (
(!currentPodCount && !!desiredPodCount);

export const getFailedPods = (pods: ExtPodKind[]): number => {
if (!pods.length) {
return 0;
}

return pods.reduce((acc, currValue) => {
if ([AllPodStatus.CrashLoopBackOff, AllPodStatus.Failed].includes(getPodStatus(currValue))) {
return acc + 1;
Expand Down

0 comments on commit 853031f

Please sign in to comment.