Do not crash if ingress is missing status.loadbalancer.ingress property (#5665)

This commit is contained in:
Lauri Nevala authored and GitHub committed 2022-06-21 11:24:02 -04:00
1 parent 0784085bf4
commit 666d90dd3c
2 files changed
+49 -2

No files matched your search

+2 -2
View File
@@ -136,7 +136,7 @@ export interface IngressSpec {
export interface IngressStatus {
loadBalancer: {
ingress: ILoadBalancerIngress[];
ingress?: ILoadBalancerIngress[];
};
}
@@ -199,7 +199,7 @@ export class Ingress extends KubeObject<IngressStatus, IngressSpec, KubeObjectSc
}
getLoadBalancers() {
return this.status?.loadBalancer.ingress.map(address => (
return this.status?.loadBalancer?.ingress?.map(address => (
address.hostname || address.ip
)) ?? [];
}