Skip to content

Commit

Permalink
Clean up new lint issues brought in by the kubernetes#3464 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
tstromberg committed May 17, 2019
1 parent b65d602 commit 8445f78
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
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
}

0 comments on commit 8445f78

Please sign in to comment.