From 6d44c8417d1026294a770a746821f88e18493110 Mon Sep 17 00:00:00 2001 From: shiywang Date: Sat, 25 Mar 2017 20:11:07 +0800 Subject: [PATCH] Fix command exec -- COMMAND can not contain spaces, update help information --- pkg/kubectl/cmd/exec.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/kubectl/cmd/exec.go b/pkg/kubectl/cmd/exec.go index fbee7685179..e7b83b1aaf1 100644 --- a/pkg/kubectl/cmd/exec.go +++ b/pkg/kubectl/cmd/exec.go @@ -47,7 +47,15 @@ var ( # Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-7890 # and sends stdout/stderr from 'bash' back to the client - kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il`)) + kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il + + # List contents of /usr from the first container of pod 123456-7890 and sort by modification time. + # If the command you want to execute in the pod has any flags in common (e.g. -i), + # you must use two dashes (--) to separate your command's flags/arguments. + # Also note, do not surround your command and its flags/arguments with quotes + # unless that is how you would execute it normally (i.e., do ls -t /usr, not "ls -t /usr"). + kubectl exec 123456-7890 -i -t -- ls -t /usr + `)) ) const (