Clean up new lint issues brought in by the #3464 merge

pull/4278/head
Thomas Stromberg 2019-05-16 19:50:27 -07:00
parent b65d602b0b
commit 8445f786a2
3 changed files with 13 additions and 8 deletions

View File

@ -94,7 +94,7 @@ 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
}
@ -102,6 +102,6 @@ func getRoute(host *host.Host, clusterConfig config.Config) (*Route, error) {
Gateway: ip,
DestCIDR: ipNet,
ClusterDomain: clusterConfig.KubernetesConfig.DNSDomain,
ClusterDNSIP: dnsIp,
ClusterDNSIP: dnsIP,
}, nil
}

View File

@ -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"
@ -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 {

View File

@ -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) {
@ -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
}