1
0

Use go timers for kill docker by timeout, fixes #12

This commit is contained in:
2018-12-08 02:53:29 +00:00
parent 49b567cd4b
commit 880af47cc5
4 changed files with 31 additions and 20 deletions

View File

@ -14,6 +14,7 @@ import (
"os/user"
"regexp"
"strings"
"time"
"github.com/jollheef/out-of-tree/config"
"github.com/naoina/toml"
@ -33,8 +34,7 @@ func matchDebianHeadersPkg(container, mask string, generic bool) (
pkgs []string, err error) {
cmd := "apt-cache search linux-headers | cut -d ' ' -f 1"
c := dockerCommand(container, "/tmp", "1m", cmd)
rawOutput, err := c.CombinedOutput()
output, err := dockerRun(time.Minute, container, "/tmp", cmd)
if err != nil {
return
}
@ -44,7 +44,7 @@ func matchDebianHeadersPkg(container, mask string, generic bool) (
return
}
kernels := r.FindAll(rawOutput, -1)
kernels := r.FindAll([]byte(output), -1)
for _, k := range kernels {
pkg := string(k)