Skip to content

Commit 1f2c26f

Browse files
committed
vfkit: Add HostIP implementation for gateway
1 parent fe6876f commit 1f2c26f

File tree

1 file changed

+4
-0
lines changed
  • pkg/minikube/cluster

1 file changed

+4
-0
lines changed

pkg/minikube/cluster/ip.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ func HostIP(host *host.Host, clusterName string) (net.IP, error) {
139139
return []byte{}, errors.Wrap(err, "Error converting VM IP address to IPv4 address")
140140
}
141141
return net.IPv4(vmIP[0], vmIP[1], vmIP[2], byte(1)), nil
142+
case driver.VFKit:
143+
vmIPString, _ := host.Driver.GetIP()
144+
gatewayIPString := vmIPString[:strings.LastIndex(vmIPString, ".")+1] + "1"
145+
return net.ParseIP(gatewayIPString), nil
142146
case driver.None:
143147
return net.ParseIP("127.0.0.1"), nil
144148
default:

0 commit comments

Comments
 (0)