pasta: use code from c/common

The code was moved to c/common so use that instead. Also add tests for
the new pasta_options config field. However there is one outstanding
problem[1]: pasta rejects most options when set more than once. Thus it is
impossible to overwrite most of them on the cli. If we cannot fix this
in pasta I need to make further changes in c/common to dedup the
options.

[1] https://archives.passt.top/passt-dev/895dae7d-3e61-4ef7-829a-87966ab0bb3a@redhat.com/

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2023-06-15 15:03:25 +02:00
parent 67674b3a63
commit 5ffbfd937d
5 changed files with 168 additions and 100 deletions

View File

@ -8,6 +8,7 @@ import (
"strconv"
"strings"
"github.com/containers/common/libnetwork/pasta"
"github.com/containers/common/pkg/apparmor"
"github.com/containers/common/pkg/cgroups"
"github.com/containers/common/pkg/seccomp"
@ -72,7 +73,7 @@ func (r *Runtime) setPlatformHostInfo(info *define.HostInfo) error {
info.Slirp4NetNS = program
}
pastaPath, _ := r.config.FindHelperBinary(pastaBinaryName, true)
pastaPath, _ := r.config.FindHelperBinary(pasta.BinaryName, true)
if pastaPath != "" {
version, err := util.ProgramVersion(pastaPath)
if err != nil {