File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -105,17 +105,13 @@ func NodeSSHHosts(c clientset.Interface) ([]string, error) {
105
105
nodelist := waitListSchedulableNodesOrDie (c )
106
106
107
107
hosts := nodeAddresses (nodelist , v1 .NodeExternalIP )
108
- // If ExternalIPs aren't set, assume the test programs can reach the
109
- // InternalIP. Simplified exception logic here assumes that the hosts will
110
- // either all have ExternalIP or none will. Simplifies handling here and
111
- // should be adequate since the setting of the external IPs is provider
112
- // specific: they should either all have them or none of them will.
113
- if len (hosts ) == 0 {
108
+ // If ExternalIPs aren't available for all nodes, try falling back to the InternalIPs.
109
+ if len (hosts ) < len (nodelist .Items ) {
114
110
e2elog .Logf ("No external IP address on nodes, falling back to internal IPs" )
115
111
hosts = nodeAddresses (nodelist , v1 .NodeInternalIP )
116
112
}
117
113
118
- // Error if any node didn 't have an external/internal IP .
114
+ // Error if neither External nor Internal IPs weren 't available for all nodes .
119
115
if len (hosts ) != len (nodelist .Items ) {
120
116
return hosts , fmt .Errorf (
121
117
"only found %d IPs on nodes, but found %d nodes. Nodelist: %v" ,
You can’t perform that action at this time.
0 commit comments