chore(deps): implement github.com/qdm12/golibs/command locally (#2418)

This commit is contained in:
Quentin McGaw
2024-08-21 15:21:31 +02:00
committed by GitHub
parent 4d60b71583
commit a2b3d7e30c
26 changed files with 537 additions and 95 deletions

View File

@@ -8,8 +8,6 @@ import (
"os/exec"
"sort"
"strings"
"github.com/qdm12/golibs/command"
)
var (
@@ -19,7 +17,7 @@ var (
ErrIPTablesNotSupported = errors.New("no iptables supported found")
)
func checkIptablesSupport(ctx context.Context, runner command.Runner,
func checkIptablesSupport(ctx context.Context, runner CmdRunner,
iptablesPathsToTry ...string) (iptablesPath string, err error) {
iptablesPathToUnsupportedMessage := make(map[string]string, len(iptablesPathsToTry))
for _, pathToTest := range iptablesPathsToTry {
@@ -62,7 +60,7 @@ func checkIptablesSupport(ctx context.Context, runner command.Runner,
}
func testIptablesPath(ctx context.Context, path string,
runner command.Runner) (ok bool, unsupportedMessage string,
runner CmdRunner) (ok bool, unsupportedMessage string,
criticalErr error) {
// Just listing iptables rules often work but we need
// to modify them to ensure we can support the iptables