Skip to content

Commit

Permalink
vfkit: Add HostIP implementation for gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
afbjorklund committed Aug 16, 2024
1 parent fe6876f commit 1f2c26f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/minikube/cluster/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ func HostIP(host *host.Host, clusterName string) (net.IP, error) {
return []byte{}, errors.Wrap(err, "Error converting VM IP address to IPv4 address")
}
return net.IPv4(vmIP[0], vmIP[1], vmIP[2], byte(1)), nil
case driver.VFKit:
vmIPString, _ := host.Driver.GetIP()
gatewayIPString := vmIPString[:strings.LastIndex(vmIPString, ".")+1] + "1"
return net.ParseIP(gatewayIPString), nil
case driver.None:
return net.ParseIP("127.0.0.1"), nil
default:
Expand Down

0 comments on commit 1f2c26f

Please sign in to comment.