Skip to content

Commit

Permalink
Adds support for showing warning icon in StatefulSet (#5055)
Browse files Browse the repository at this point in the history
* Adds suport for showing warning icon when pods down than desired

Signed-off-by: Harkishen Singh <harkishensingh@hotmail.com>

* updated stateful set logic

Signed-off-by: Harkishen Singh <harkishensingh@hotmail.com>

* removed false constructor and status column in statefulsets

Signed-off-by: Harkishen Singh <harkishensingh@hotmail.com>

* linted

Signed-off-by: Harkishen Singh <harkishensingh@hotmail.com>
  • Loading branch information
Harkishen-Singh committed Apr 13, 2020
1 parent 6ab57ed commit 7d7c1b3
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
ComponentFactoryResolver,
Input,
} from '@angular/core';
import {Event, Metric, StatefulSet, StatefulSetList} from '@api/backendapi';
import {Event, Metric, StatefulSet, StatefulSetList, PodInfo} from '@api/backendapi';
import {Observable} from 'rxjs/Observable';
import {ResourceListWithStatuses} from '../../../resources/list';
import {NotificationsService} from '../../../services/global/notifications';
Expand Down Expand Up @@ -78,11 +78,18 @@ export class StatefulSetListComponent extends ResourceListWithStatuses<
}

isInPendingState(resource: StatefulSet): boolean {
return resource.podInfo.warnings.length === 0 && resource.podInfo.pending > 0;
return (
resource.podInfo.warnings.length === 0 &&
(resource.podInfo.pending > 0 || resource.podInfo.running !== resource.podInfo.desired)
);
}

isInSuccessState(resource: StatefulSet): boolean {
return resource.podInfo.warnings.length === 0 && resource.podInfo.pending === 0;
return (
resource.podInfo.warnings.length === 0 &&
resource.podInfo.pending === 0 &&
resource.podInfo.running === resource.podInfo.desired
);
}

getDisplayColumns(): string[] {
Expand Down

0 comments on commit 7d7c1b3

Please sign in to comment.