diff --git a/providers/docker/handler.go b/providers/docker/handler.go index dee08c8..e6055ed 100644 --- a/providers/docker/handler.go +++ b/providers/docker/handler.go @@ -70,7 +70,11 @@ func (h *ContainerHandler) GetCLI() (probe.CliExecutor, error) { args = append(args, "-s", "localhost:5002") logrus.Tracef("checking cli socket error: %v, using flag '%s' for vppctl", err, args) } - wrapper := exec.Wrap(h, "/usr/bin/vppctl", args...) + vppctl := "/usr/bin/vppctl" + if _, err := h.Command("ls", vppctl).Output(); err != nil { + vppctl = "vppctl" + } + wrapper := exec.Wrap(h, vppctl, args...) cli := vppcli.ExecutorFunc(func(cmd string) (string, error) { out, err := wrapper.Command(cmd).Output() if err != nil { diff --git a/vpp/instance.go b/vpp/instance.go index 2d2d2e3..7cc2e64 100644 --- a/vpp/instance.go +++ b/vpp/instance.go @@ -213,7 +213,11 @@ func (v *Instance) initCLI() error { args = append(args, "-s", defaultCliAddr) logrus.Tracef("checking cli socket error: %v, using flag '%s' for vppctl", err, args) } - wrapper := exec.Wrap(v.handler, "/usr/bin/vppctl", args...) + vppctl := "/usr/bin/vppctl" + if _, err := v.handler.Command("ls", vppctl).Output(); err != nil { + vppctl = "vppctl" + } + wrapper := exec.Wrap(v.handler, vppctl, args...) cli := vppcli.ExecutorFunc(func(cmd string) (string, error) { c := `"` + cmd + `"` out, err := wrapper.Command(c).Output()