mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 03:08:15 +00:00
Use dedent for the kubectl commands
The one side effect is that for the "kubectl help" commands a newline is prepended to output, which will alter the yaml output. Here we use dedent to format the code to match the output. hack/update-generated-docs.sh has been run and the affected files have been added. Note: for describe.go we added a period to the end of an output message.
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
||||
|
||||
"github.com/docker/docker/pkg/term"
|
||||
"github.com/golang/glog"
|
||||
"github.com/renstrom/dedent"
|
||||
"github.com/spf13/cobra"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/client/restclient"
|
||||
@@ -35,16 +36,17 @@ import (
|
||||
remotecommandserver "k8s.io/kubernetes/pkg/kubelet/server/remotecommand"
|
||||
)
|
||||
|
||||
const (
|
||||
exec_example = `# Get output from running 'date' from pod 123456-7890, using the first container by default
|
||||
kubectl exec 123456-7890 date
|
||||
var (
|
||||
exec_example = dedent.Dedent(`
|
||||
# Get output from running 'date' from pod 123456-7890, using the first container by default
|
||||
kubectl exec 123456-7890 date
|
||||
|
||||
# Get output from running 'date' in ruby-container from pod 123456-7890
|
||||
kubectl exec 123456-7890 -c ruby-container date
|
||||
# Get output from running 'date' in ruby-container from pod 123456-7890
|
||||
kubectl exec 123456-7890 -c ruby-container date
|
||||
|
||||
# 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`
|
||||
# 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`)
|
||||
)
|
||||
|
||||
func NewCmdExec(f *cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer) *cobra.Command {
|
||||
|
||||
Reference in New Issue
Block a user