Skip to content

Commit 146499e

Browse files
authored
Merge pull request #4278 from tstromberg/lint-issues
Lint cleanup after merging tunnel DNS resolution
2 parents b65d602 + 8445f78 commit 146499e

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

pkg/minikube/tunnel/cluster_inspector.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ func getRoute(host *host.Host, clusterConfig config.Config) (*Route, error) {
9494
if ip == nil {
9595
return nil, fmt.Errorf("invalid IP for host %s", hostDriverIP)
9696
}
97-
dnsIp, err := util.GetDNSIP(ipNet.String())
97+
dnsIP, err := util.GetDNSIP(ipNet.String())
9898
if err != nil {
9999
return nil, err
100100
}
101101
return &Route{
102102
Gateway: ip,
103103
DestCIDR: ipNet,
104104
ClusterDomain: clusterConfig.KubernetesConfig.DNSDomain,
105-
ClusterDNSIP: dnsIp,
105+
ClusterDNSIP: dnsIP,
106106
}, nil
107107
}

pkg/minikube/tunnel/cluster_inspector_test.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ limitations under the License.
1717
package tunnel
1818

1919
import (
20-
"k8s.io/minikube/pkg/util"
2120
"testing"
2221

22+
"k8s.io/minikube/pkg/util"
23+
2324
"net"
2425
"reflect"
2526
"strings"
@@ -79,12 +80,15 @@ func TestMinikubeCheckReturnsHostInformation(t *testing.T) {
7980

8081
ip := net.ParseIP("1.2.3.4")
8182
_, ipNet, _ := net.ParseCIDR("96.0.0.0/12")
82-
dnsIp, _ := util.GetDNSIP(ipNet.String())
83+
dnsIP, err := util.GetDNSIP(ipNet.String())
84+
if err != nil {
85+
t.Errorf("getdnsIP: %v", err)
86+
}
8387

8488
expectedRoute := &Route{
8589
Gateway: ip,
8690
DestCIDR: ipNet,
87-
ClusterDNSIP: dnsIp,
91+
ClusterDNSIP: dnsIP,
8892
}
8993

9094
if s != Running {

pkg/minikube/tunnel/route_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ limitations under the License.
1717
package tunnel
1818

1919
import (
20-
"k8s.io/minikube/pkg/util"
2120
"net"
2221
"reflect"
2322
"testing"
23+
24+
"k8s.io/minikube/pkg/util"
2425
)
2526

2627
func TestRoutingTable(t *testing.T) {
@@ -131,12 +132,12 @@ got
131132
func unsafeParseRoute(gatewayIP string, destCIDR string) *Route {
132133
ip := net.ParseIP(gatewayIP)
133134
_, ipNet, _ := net.ParseCIDR(destCIDR)
134-
dnsIp, _ := util.GetDNSIP(ipNet.String())
135+
dnsIP, _ := util.GetDNSIP(ipNet.String())
135136

136137
expectedRoute := &Route{
137138
Gateway: ip,
138139
DestCIDR: ipNet,
139-
ClusterDNSIP: dnsIp,
140+
ClusterDNSIP: dnsIP,
140141
}
141142
return expectedRoute
142143
}

0 commit comments

Comments
 (0)