This repository was archived by the owner on Nov 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +1
-24
lines changed Expand file tree Collapse file tree 1 file changed +1
-24
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ import (
22
22
"fmt"
23
23
"os"
24
24
"os/exec"
25
- "os/signal"
26
25
"path/filepath"
27
26
"regexp"
28
27
"runtime"
@@ -135,35 +134,13 @@ func Exec(_ *cobra.Command) {
135
134
os .Exit (0 )
136
135
}
137
136
138
- // RunDocker runs a docker command, and forward signals to the shellout command (stops listening to signals when an event is sent to childExit)
137
+ // RunDocker runs a docker command
139
138
func RunDocker (childExit chan bool , args ... string ) error {
140
139
cmd := exec .Command (comDockerCli (), args ... )
141
140
cmd .Stdin = os .Stdin
142
141
cmd .Stdout = os .Stdout
143
142
cmd .Stderr = os .Stderr
144
143
145
- signals := make (chan os.Signal , 1 )
146
- signal .Notify (signals ) // catch all signals
147
- go func () {
148
- for {
149
- select {
150
- case sig := <- signals :
151
- if cmd .Process == nil {
152
- continue // can happen if receiving signal before the process is actually started
153
- }
154
- // In go1.14+, the go runtime issues SIGURG as an interrupt to
155
- // support preemptable system calls on Linux. Since we can't
156
- // forward that along we'll check that here.
157
- if isRuntimeSig (sig ) {
158
- continue
159
- }
160
- _ = cmd .Process .Signal (sig )
161
- case <- childExit :
162
- return
163
- }
164
- }
165
- }()
166
-
167
144
return cmd .Run ()
168
145
}
169
146
You can’t perform that action at this time.
0 commit comments