Merge pull request #15720 from p2c2e/master

Infer HyperKit HostIP as Gateway rather than hardcode to 192.168.64.1
pull/15882/head
Medya Ghazizadeh 2023-02-16 13:32:33 -08:00 committed by GitHub
commit 0ffc25385d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -126,7 +126,9 @@ func HostIP(host *host.Host, clusterName string) (net.IP, error) {
return net.ParseIP(ip), nil
case driver.HyperKit:
return net.ParseIP("192.168.64.1"), nil
vmIPString, _ := host.Driver.GetIP()
gatewayIPString := vmIPString[:strings.LastIndex(vmIPString, ".")+1] + "1"
return net.ParseIP(gatewayIPString), nil
case driver.VMware:
vmIPString, err := host.Driver.GetIP()
if err != nil {