diff --git a/pkg/commands/run.go b/pkg/commands/run.go index 5143268082..55efa3b9a3 100644 --- a/pkg/commands/run.go +++ b/pkg/commands/run.go @@ -67,8 +67,8 @@ func addRun(topLevel *cobra.Command) { kubectlArgs := []string{} dashes = unparsedDashes() - if dashes != -1 { - kubectlArgs = os.Args[dashes:] + if dashes != -1 && dashes != len(os.Args) { + kubectlArgs = os.Args[dashes+1:] } bo.InsecureRegistry = po.InsecureRegistry @@ -102,7 +102,6 @@ func addRun(topLevel *cobra.Command) { // These are better defaults: defaults := []string{ - "--generator=run-pod/v1", // create a pod instead of deployment "--attach", // stream logs back "--rm", // clean up after ourselves "--restart=Never", // we just want to run once