diff --git a/cmd/kubectl-testkube/commands/tests/common.go b/cmd/kubectl-testkube/commands/tests/common.go index ed136379aa8..4c56482f4d8 100644 --- a/cmd/kubectl-testkube/commands/tests/common.go +++ b/cmd/kubectl-testkube/commands/tests/common.go @@ -530,7 +530,12 @@ func newExecutionRequestFromFlags(cmd *cobra.Command) (request *testkube.Executi return nil, err } - executorArgs, err := cmd.Flags().GetStringArray("executor-args") + binaryArgs, err := cmd.Flags().GetStringArray("executor-args") + if err != nil { + return nil, err + } + + executorArgs, err := testkube.PrepareExecutorArgs(binaryArgs) if err != nil { return nil, err } @@ -1044,7 +1049,12 @@ func newExecutionUpdateRequestFromFlags(cmd *cobra.Command) (request *testkube.E } if cmd.Flag("executor-args").Changed { - executorArgs, err := cmd.Flags().GetStringArray("executor-args") + binaryArgs, err := cmd.Flags().GetStringArray("executor-args") + if err != nil { + return nil, err + } + + executorArgs, err := testkube.PrepareExecutorArgs(binaryArgs) if err != nil { return nil, err } diff --git a/cmd/kubectl-testkube/commands/tests/run.go b/cmd/kubectl-testkube/commands/tests/run.go index 3409b5aa57a..cb8869a5528 100644 --- a/cmd/kubectl-testkube/commands/tests/run.go +++ b/cmd/kubectl-testkube/commands/tests/run.go @@ -25,7 +25,7 @@ func NewRunTestCmd() *cobra.Command { image string iterations int watchEnabled bool - executorArgs []string + binaryArgs []string variables []string secretVariables []string variablesFile string @@ -115,6 +115,9 @@ func NewRunTestCmd() *cobra.Command { variables, err := common.CreateVariables(cmd, !info.SecretConfig().AutoCreate) ui.WarnOnErrorAndOutputPretty("getting variables", outputPretty, err) + executorArgs, err := testkube.PrepareExecutorArgs(binaryArgs) + ui.ExitOnError("getting args", err) + envConfigMaps, envSecrets, err := newEnvReferencesFromFlags(cmd) ui.WarnOnErrorAndOutputPretty("getting env config maps and secrets", outputPretty, err) @@ -412,7 +415,7 @@ func NewRunTestCmd() *cobra.Command { cmd.Flags().StringArrayVarP(&variables, "variable", "v", []string{}, "execution variable passed to executor") cmd.Flags().StringArrayVarP(&secretVariables, "secret-variable", "s", []string{}, "execution secret variable passed to executor") cmd.Flags().StringArrayVar(&command, "command", []string{}, "command passed to image in executor") - cmd.Flags().StringArrayVarP(&executorArgs, "args", "", []string{}, "executor binary additional arguments") + cmd.Flags().StringArrayVarP(&binaryArgs, "args", "", []string{}, "executor binary additional arguments") cmd.Flags().StringVarP(&argsMode, "args-mode", "", "append", "usage mode for argumnets. one of append|override|replace") cmd.Flags().BoolVarP(&watchEnabled, "watch", "f", false, "watch for changes after start") cmd.Flags().StringVar(&downloadDir, "download-dir", "artifacts", "download dir")