@@ -32,9 +32,9 @@ import (
32
32
"k8s.io/minikube/pkg/minikube/constants"
33
33
)
34
34
35
- //tunnel represents the basic API for a tunnel: periodically the state of the tunnel
36
- //can be updated and when the tunnel is not needed, it can be cleaned up
37
- //It was mostly introduced for testability.
35
+ // tunnel represents the basic API for a tunnel: periodically the state of the tunnel
36
+ // can be updated and when the tunnel is not needed, it can be cleaned up
37
+ // It was mostly introduced for testability.
38
38
type controller interface {
39
39
cleanup () * Status
40
40
update () * Status
@@ -85,7 +85,7 @@ func newTunnel(machineName string, machineAPI libmachine.API, configLoader confi
85
85
}
86
86
87
87
type tunnel struct {
88
- //collaborators
88
+ // collaborators
89
89
clusterInspector * clusterInspector
90
90
router router
91
91
loadBalancerEmulator loadBalancerEmulator
@@ -142,16 +142,16 @@ func setupRoute(t *tunnel, h *host.Host) {
142
142
if t .status .RouteError != nil {
143
143
return
144
144
}
145
- //the route was added successfully, we need to make sure the registry has it too
146
- //this might fail in race conditions, when another process created this tunnel
145
+ // the route was added successfully, we need to make sure the registry has it too
146
+ // this might fail in race conditions, when another process created this tunnel
147
147
if err := t .registry .Register (& t .status .TunnelID ); err != nil {
148
148
glog .Errorf ("failed to register tunnel: %s" , err )
149
149
t .status .RouteError = err
150
150
return
151
151
}
152
152
153
153
if h .DriverName == constants .DriverHyperkit {
154
- //the virtio-net interface acts up with ip tunnels :(
154
+ // the virtio-net interface acts up with ip tunnels :(
155
155
setupBridge (t )
156
156
if t .status .RouteError != nil {
157
157
return
@@ -166,7 +166,7 @@ func setupRoute(t *tunnel, h *host.Host) {
166
166
return
167
167
}
168
168
169
- //the route exists, make sure that this process owns it in the registry
169
+ // the route exists, make sure that this process owns it in the registry
170
170
existingTunnel , err := t .registry .IsAlreadyDefinedAndRunning (& t .status .TunnelID )
171
171
if err != nil {
172
172
glog .Errorf ("failed to check for other tunnels: %s" , err )
@@ -175,7 +175,7 @@ func setupRoute(t *tunnel, h *host.Host) {
175
175
}
176
176
177
177
if existingTunnel == nil {
178
- //the route exists, but "orphaned", this process will "own it" in the registry
178
+ // the route exists, but "orphaned", this process will "own it" in the registry
179
179
if err := t .registry .Register (& t .status .TunnelID ); err != nil {
180
180
glog .Errorf ("failed to register tunnel: %s" , err )
181
181
t .status .RouteError = err
@@ -184,7 +184,7 @@ func setupRoute(t *tunnel, h *host.Host) {
184
184
}
185
185
186
186
if existingTunnel .Pid != getPid () {
187
- //another running process owns the tunnel
187
+ // another running process owns the tunnel
188
188
t .status .RouteError = errorTunnelAlreadyExists (existingTunnel )
189
189
return
190
190
}
0 commit comments