Fix FetchIngressIP error checking

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson
2025-02-07 22:57:16 +00:00
committed by Brad Davidson
parent c61b8c077a
commit 9f3a64fcd8

View File

@@ -348,12 +348,11 @@ func FetchIngressIP(kubeconfig string) ([]string, error) {
if err != nil {
return nil, err
}
ingressIP := strings.Trim(res, " ")
ingressIPs := strings.Split(ingressIP, " ")
if len(ingressIPs) == 0 {
return nil, errors.New("no ingress IP found")
res = strings.TrimSpace(res)
if res == "" {
return nil, errors.New("no ingress IPs found")
}
return ingressIPs, nil
return strings.Split(res, " "), nil
}
func (v VagrantNode) FetchNodeExternalIP() (string, error) {