Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DOCKER_HOST not being numeric IP #13300

Merged
merged 3 commits into from
Jan 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pkg/minikube/driver/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,28 @@ func ControlPlaneEndpoint(cc *config.ClusterConfig, cp *config.Node, driverName
}
hostname := oci.DaemonHost(driverName)

ip := net.ParseIP(hostname)
if ip == nil {
return hostname, ip, port, fmt.Errorf("failed to parse ip for %q", hostname)
ips, err := net.LookupIP(hostname)
if err != nil || len(ips) == 0 {
return hostname, nil, port, fmt.Errorf("failed to lookup ip for %q", hostname)
}

// https://github.com/kubernetes/minikube/issues/3878
if cc.KubernetesConfig.APIServerName != constants.APIServerName {
hostname = cc.KubernetesConfig.APIServerName
}
return hostname, ip, port, err
return hostname, ips[0], port, err
}

// https://github.com/kubernetes/minikube/issues/3878
hostname := cp.IP
if cc.KubernetesConfig.APIServerName != constants.APIServerName {
hostname = cc.KubernetesConfig.APIServerName
}
ip := net.ParseIP(cp.IP)
if ip == nil {
return hostname, ip, cp.Port, fmt.Errorf("failed to parse ip for %q", cp.IP)
ips, err := net.LookupIP(cp.IP)
if err != nil || len(ips) == 0 {
return hostname, nil, cp.Port, fmt.Errorf("failed to lookup ip for %q", cp.IP)
}
return hostname, ip, cp.Port, nil
return hostname, ips[0], cp.Port, nil
}

// AutoPauseProxyEndpoint returns the endpoint for the auto-pause (reverse proxy to api-sever)
Expand Down