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

Lint cleanup after merging tunnel DNS resolution #4278

Merged
merged 1 commit into from
May 17, 2019
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions pkg/minikube/tunnel/cluster_inspector.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ func getRoute(host *host.Host, clusterConfig config.Config) (*Route, error) {
if ip == nil {
return nil, fmt.Errorf("invalid IP for host %s", hostDriverIP)
}
dnsIp, err := util.GetDNSIP(ipNet.String())
dnsIP, err := util.GetDNSIP(ipNet.String())
if err != nil {
return nil, err
}
return &Route{
Gateway: ip,
DestCIDR: ipNet,
ClusterDomain: clusterConfig.KubernetesConfig.DNSDomain,
ClusterDNSIP: dnsIp,
ClusterDNSIP: dnsIP,
}, nil
}
10 changes: 7 additions & 3 deletions pkg/minikube/tunnel/cluster_inspector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ limitations under the License.
package tunnel

import (
"k8s.io/minikube/pkg/util"
"testing"

"k8s.io/minikube/pkg/util"

"net"
"reflect"
"strings"
Expand Down Expand Up @@ -79,12 +80,15 @@ func TestMinikubeCheckReturnsHostInformation(t *testing.T) {

ip := net.ParseIP("1.2.3.4")
_, ipNet, _ := net.ParseCIDR("96.0.0.0/12")
dnsIp, _ := util.GetDNSIP(ipNet.String())
dnsIP, err := util.GetDNSIP(ipNet.String())
if err != nil {
t.Errorf("getdnsIP: %v", err)
}

expectedRoute := &Route{
Gateway: ip,
DestCIDR: ipNet,
ClusterDNSIP: dnsIp,
ClusterDNSIP: dnsIP,
}

if s != Running {
Expand Down
7 changes: 4 additions & 3 deletions pkg/minikube/tunnel/route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ limitations under the License.
package tunnel

import (
"k8s.io/minikube/pkg/util"
"net"
"reflect"
"testing"

"k8s.io/minikube/pkg/util"
)

func TestRoutingTable(t *testing.T) {
Expand Down Expand Up @@ -131,12 +132,12 @@ got
func unsafeParseRoute(gatewayIP string, destCIDR string) *Route {
ip := net.ParseIP(gatewayIP)
_, ipNet, _ := net.ParseCIDR(destCIDR)
dnsIp, _ := util.GetDNSIP(ipNet.String())
dnsIP, _ := util.GetDNSIP(ipNet.String())

expectedRoute := &Route{
Gateway: ip,
DestCIDR: ipNet,
ClusterDNSIP: dnsIp,
ClusterDNSIP: dnsIP,
}
return expectedRoute
}