fix pod status and count in control plane dashboard (#659)

* fix pod status and count display in control plane dashboard section:
- the control plane would show terminated and stale deployments in the UI, this is confusing and might indicate errors
- this filters out temrinated and failed component deploys from the UI
- it is to note that pending deploys will still be counted and represented with a greyed out status dot
- Fixes: #606

Signed-off-by: Franziska von der Goltz <franziska@vdgoltz.eu>


Signed-off-by: Franziska von der Goltz <franziska@vdgoltz.eu>
This commit is contained in:
Franziska von der Goltz 2018-04-03 10:39:35 -07:00 committed by GitHub
parent 19001f8d38
commit eff848a8cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -11,6 +11,7 @@ import { rowGutter } from './util/Utils.js';
import StatusTable from './StatusTable.jsx'; import StatusTable from './StatusTable.jsx';
import { Col, Row, Table } from 'antd'; import { Col, Row, Table } from 'antd';
import { import {
getComponentPods,
getPodsByDeployment, getPodsByDeployment,
processRollupMetrics, processRollupMetrics,
processTimeseriesMetrics processTimeseriesMetrics
@ -178,10 +179,7 @@ export default class ServiceMesh extends React.Component {
return _(componentNames) return _(componentNames)
.map((name, id) => { .map((name, id) => {
let componentPods = _.get(podIndex, _.get(componentDeploys, id), []); let componentPods = _.get(podIndex, _.get(componentDeploys, id), []);
let podStatuses = _.map(componentPods, p => { return { name: name, pods: getComponentPods(componentPods) };
return { name: p.name, value: p.status === "Running" ? "good" : "bad" };
});
return { name: name, pods: _.sortBy(podStatuses, "name") };
}) })
.sortBy("name") .sortBy("name")
.value(); .value();

View File

@ -60,6 +60,16 @@ export const getPodsByDeployment = pods => {
.value(); .value();
}; };
export const getComponentPods = componentPods => {
return _.chain(componentPods)
.map( p => {
return { name: p.name, value: getPodCategorization(p) };
})
.reject(p => _.isEmpty(p.value))
.sortBy("name")
.value();
};
export const processTimeseriesMetrics = (rawTs, targetEntity) => { export const processTimeseriesMetrics = (rawTs, targetEntity) => {
let tsbyEntity = _.groupBy(rawTs, "metadata." + targetEntity); let tsbyEntity = _.groupBy(rawTs, "metadata." + targetEntity);
return _.reduce(tsbyEntity, (mem, metrics, entity) => { return _.reduce(tsbyEntity, (mem, metrics, entity) => {