integration: fix rootless worker binaries closing after tests

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
v0.8
Tonis Tiigi 2020-07-17 19:21:50 -07:00
parent 8247b7b50b
commit 55e29c1abe
2 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ func (s *oci) New(cfg *BackendConfig) (Backend, func() error, error) {
return nil, nil, errors.Errorf("unsupported id pair: uid=%d, gid=%d", s.uid, s.gid)
}
// TODO: make sure the user exists and subuid/subgid are configured.
buildkitdArgs = append([]string{"sudo", "-u", fmt.Sprintf("#%d", s.uid), "-i", "--", "rootlesskit"}, buildkitdArgs...)
buildkitdArgs = append([]string{"sudo", "-u", fmt.Sprintf("#%d", s.uid), "-i", "--", "exec", "rootlesskit"}, buildkitdArgs...)
}
buildkitdSock, stop, err := runBuildkitd(cfg, buildkitdArgs, cfg.Logs, s.uid, s.gid)

View File

@ -204,7 +204,7 @@ func runBuildkitd(conf *BackendConfig, args []string, logs map[string]*bytes.Buf
}
func rootlessSupported(uid int) bool {
cmd := exec.Command("sudo", "-u", fmt.Sprintf("#%d", uid), "-i", "--", "unshare", "-U", "true")
cmd := exec.Command("sudo", "-u", fmt.Sprintf("#%d", uid), "-i", "--", "exec", "unshare", "-U", "true")
b, err := cmd.CombinedOutput()
if err != nil {
logrus.Warnf("rootless mode is not supported on this host: %v (%s)", err, string(b))