mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Use spec.serviceName as an externalIP if nothing else
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
9e2ee00974
commit
a28e4031f2
@ -53,7 +53,7 @@ export interface Service {
|
|||||||
clusterIP: string;
|
clusterIP: string;
|
||||||
clusterIPs?: string[];
|
clusterIPs?: string[];
|
||||||
externalTrafficPolicy?: string;
|
externalTrafficPolicy?: string;
|
||||||
externalName: string;
|
externalName?: string;
|
||||||
loadBalancerIP?: string;
|
loadBalancerIP?: string;
|
||||||
loadBalancerSourceRanges?: string[];
|
loadBalancerSourceRanges?: string[];
|
||||||
sessionAffinity: string;
|
sessionAffinity: string;
|
||||||
@ -100,11 +100,19 @@ export class Service extends KubeObject {
|
|||||||
getExternalIps() {
|
getExternalIps() {
|
||||||
const lb = this.getLoadBalancer();
|
const lb = this.getLoadBalancer();
|
||||||
|
|
||||||
if (lb && lb.ingress) {
|
if (lb?.ingress) {
|
||||||
return lb.ingress.map(val => val.ip || val.hostname);
|
return lb.ingress.map(val => val.ip || val.hostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.spec.externalIPs || [];
|
if (Array.isArray(this.spec?.externalIPs)) {
|
||||||
|
return this.spec.externalIPs;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.spec.externalName) {
|
||||||
|
return [this.spec.externalName];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
getType() {
|
getType() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user