Skip to content

Commit 9f3a64f

Browse files
committed
Fix FetchIngressIP error checking
Signed-off-by: Brad Davidson <[email protected]>
1 parent c61b8c0 commit 9f3a64f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/e2e/testutils.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -348,12 +348,11 @@ func FetchIngressIP(kubeconfig string) ([]string, error) {
348348
if err != nil {
349349
return nil, err
350350
}
351-
ingressIP := strings.Trim(res, " ")
352-
ingressIPs := strings.Split(ingressIP, " ")
353-
if len(ingressIPs) == 0 {
354-
return nil, errors.New("no ingress IP found")
351+
res = strings.TrimSpace(res)
352+
if res == "" {
353+
return nil, errors.New("no ingress IPs found")
355354
}
356-
return ingressIPs, nil
355+
return strings.Split(res, " "), nil
357356
}
358357

359358
func (v VagrantNode) FetchNodeExternalIP() (string, error) {

0 commit comments

Comments
 (0)