From 8279397dbb9cd9e657b933c11cec30dfbd2f4567 Mon Sep 17 00:00:00 2001 From: Justen Walker Date: Mon, 28 Feb 2022 12:39:09 -0500 Subject: [PATCH] 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 --- internal/cmd/commands/connect/connect.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/cmd/commands/connect/connect.go b/internal/cmd/commands/connect/connect.go index 7b8b9b9d62..c40a93d2b0 100644 --- a/internal/cmd/commands/connect/connect.go +++ b/internal/cmd/commands/connect/connect.go @@ -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 } }