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 (#4188)
* Use spec.serviceName as an externalIP if nothing else Signed-off-by: Sebastian Malton <sebastian@malton.name> * Move using externalName to display logic Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
c7e38052fc
commit
4d63ef2878
3 files changed
+34
-17
No files matched your search
@@ -53,7 +53,7 @@ export interface Service {
|
||||
clusterIP: string;
|
||||
clusterIPs?: string[];
|
||||
externalTrafficPolicy?: string;
|
||||
externalName: string;
|
||||
externalName?: string;
|
||||
loadBalancerIP?: string;
|
||||
loadBalancerSourceRanges?: string[];
|
||||
sessionAffinity: string;
|
||||
@@ -100,11 +100,15 @@ export class Service extends KubeObject {
|
||||
getExternalIps() {
|
||||
const lb = this.getLoadBalancer();
|
||||
|
||||
if (lb && lb.ingress) {
|
||||
if (lb?.ingress) {
|
||||
return lb.ingress.map(val => val.ip || val.hostname);
|
||||
}
|
||||
|
||||
return this.spec.externalIPs || [];
|
||||
if (Array.isArray(this.spec?.externalIPs)) {
|
||||
return this.spec.externalIPs;
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
getType() {
|
||||
|
||||
Reference in new issue
Block a user