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
pull/1881/head
Justen Walker 4 years ago committed by GitHub
parent d52f841d8b
commit 8279397dbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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
}
}

Loading…
Cancel
Save