@@ -32,7 +32,7 @@ import (
32
32
"k8s.io/minikube/pkg/minikube/style"
33
33
)
34
34
35
- var incomeCh = make (chan struct {})
35
+ var unpauseRequests = make (chan struct {})
36
36
var done = make (chan struct {})
37
37
var mu sync.Mutex
38
38
@@ -53,7 +53,7 @@ func main() {
53
53
select {
54
54
case <- time .After (interval ):
55
55
runPause ()
56
- case <- incomeCh :
56
+ case <- unpauseRequests :
57
57
fmt .Printf ("Got request\n " )
58
58
if runtimePaused {
59
59
runUnpause ()
@@ -71,7 +71,7 @@ func main() {
71
71
72
72
// handler echoes the Path component of the requested URL.
73
73
func handler (w http.ResponseWriter , r * http.Request ) {
74
- incomeCh <- struct {}{}
74
+ unpauseRequests <- struct {}{}
75
75
<- done
76
76
fmt .Fprintf (w , "allow" )
77
77
}
@@ -83,8 +83,6 @@ func runPause() {
83
83
return
84
84
}
85
85
86
- ids := []string {}
87
-
88
86
r := command .NewExecRunner (true )
89
87
90
88
cr , err := cruntime .New (cruntime.Config {Type : runtime , Runner : r })
@@ -98,18 +96,15 @@ func runPause() {
98
96
}
99
97
100
98
runtimePaused = true
101
- ids = append (ids , uids ... )
102
99
103
- out .Step (style .Unpause , "Paused {{.count}} containers" , out.V {"count" : len (ids )})
100
+ out .Step (style .Unpause , "Paused {{.count}} containers" , out.V {"count" : len (uids )})
104
101
}
105
102
106
103
func runUnpause () {
107
104
fmt .Println ("unpausing..." )
108
105
mu .Lock ()
109
106
defer mu .Unlock ()
110
107
111
- ids := []string {}
112
-
113
108
r := command .NewExecRunner (true )
114
109
115
110
cr , err := cruntime .New (cruntime.Config {Type : runtime , Runner : r })
@@ -121,8 +116,7 @@ func runUnpause() {
121
116
if err != nil {
122
117
exit .Error (reason .GuestUnpause , "Unpause" , err )
123
118
}
124
- ids = append (ids , uids ... )
125
119
runtimePaused = false
126
120
127
- out .Step (style .Unpause , "Unpaused {{.count}} containers" , out.V {"count" : len (ids )})
121
+ out .Step (style .Unpause , "Unpaused {{.count}} containers" , out.V {"count" : len (uids )})
128
122
}
0 commit comments