fix(connect): do not panic on multiple -- args (#1858)

Passthrough args looks for the an instance of -- and re-slices the arg
list to pass through those args to the underlying connect exec command.
However such commands may also need to parse their own '--', such as
kubectl exec.

This change updates the logic so that boundary arg parser only considers
the first instance of '--' when deciding which args to pass to the
-exec= commands.

Fixes: #1857
This commit is contained in:
Justen Walker authored and GitHub committed 2022-02-28 10:39:09 -07:00
1 parent d52f841d8b
commit 8279397dbb
1 file changed
+1
+1
View File
@@ -264,6 +264,7 @@ func (c *Command) Run(args []string) (retCode int) {
if v == "--" {
passthroughArgs = args[i+1:]
args = args[:i]
break // only consider the first instance of '--' in the args list
}
}