mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Check object instanceof on all detail panels (#4054)
* Check object instanceof on all detail panels Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix unit tests - Remove prettier as snapShot testing is too tight of a bound Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
dabfce3609
commit
052d12fc19
32 files changed
+392
-168
No files matched your search
@@ -25,7 +25,7 @@ import React from "react";
|
||||
import { disposeOnUnmount, observer } from "mobx-react";
|
||||
import { makeObservable, observable, reaction } from "mobx";
|
||||
import { DrawerItem, DrawerTitle } from "../drawer";
|
||||
import type { ILoadBalancerIngress, Ingress } from "../../../common/k8s-api/endpoints";
|
||||
import { ILoadBalancerIngress, Ingress } from "../../../common/k8s-api/endpoints";
|
||||
import { Table, TableCell, TableHead, TableRow } from "../table";
|
||||
import { ResourceMetrics } from "../resource-metrics";
|
||||
import type { KubeObjectDetailsProps } from "../kube-object-details";
|
||||
@@ -35,6 +35,7 @@ import { getBackendServiceNamePort, getMetricsForIngress, IIngressMetrics } from
|
||||
import { getActiveClusterEntity } from "../../api/catalog-entity-registry";
|
||||
import { ClusterMetricsResourceType } from "../../../common/cluster-types";
|
||||
import { boundMethod } from "../../utils";
|
||||
import logger from "../../../common/logger";
|
||||
|
||||
interface Props extends KubeObjectDetailsProps<Ingress> {
|
||||
}
|
||||
@@ -132,6 +133,12 @@ export class IngressDetails extends React.Component<Props> {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!(ingress instanceof Ingress)) {
|
||||
logger.error("[IngressDetails]: passed object that is not an instanceof Ingress", ingress);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
const { spec, status } = ingress;
|
||||
const ingressPoints = status?.loadBalancer?.ingress;
|
||||
const { metrics } = this;
|
||||
|
||||
Reference in new issue
Block a user