1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 22:39:41 +02:00

feat: kubernets service - display external hostname (#486)

This commit is contained in:
Steven Kang 2025-03-12 22:34:00 +13:00 committed by GitHub
parent 28b222fffa
commit 798fa2396a
4 changed files with 45 additions and 5 deletions

View file

@ -81,8 +81,8 @@ func parseService(service corev1.Service) models.K8sServiceInfo {
ingressStatus := make([]models.K8sServiceIngress, 0)
for _, status := range service.Status.LoadBalancer.Ingress {
ingressStatus = append(ingressStatus, models.K8sServiceIngress{
IP: status.IP,
Host: status.Hostname,
IP: status.IP,
Hostname: status.Hostname,
})
}
@ -130,7 +130,7 @@ func (kcl *KubeClient) convertToK8sService(info models.K8sServiceInfo) corev1.Se
for _, i := range info.IngressStatus {
service.Status.LoadBalancer.Ingress = append(
service.Status.LoadBalancer.Ingress,
corev1.LoadBalancerIngress{IP: i.IP, Hostname: i.Host},
corev1.LoadBalancerIngress{IP: i.IP, Hostname: i.Hostname},
)
}