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:
Michael Rubin
2016-05-20 10:49:56 -07:00
parent 77cfa34fd9
commit 760b04e294
44 changed files with 686 additions and 548 deletions

View File

@@ -20,6 +20,7 @@ import (
"fmt"
"io"
"github.com/renstrom/dedent"
"k8s.io/kubernetes/pkg/kubectl"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/kubectl/resource"
@@ -34,13 +35,15 @@ type HistoryOptions struct {
Recursive bool
}
const (
history_long = `View previous rollout revisions and configurations.`
history_example = `# View the rollout history of a deployment
kubectl rollout history deployment/abc
var (
history_long = dedent.Dedent(`
View previous rollout revisions and configurations.`)
history_example = dedent.Dedent(`
# View the rollout history of a deployment
kubectl rollout history deployment/abc
# View the details of deployment revision 3
kubectl rollout history deployment/abc --revision=3`
# View the details of deployment revision 3
kubectl rollout history deployment/abc --revision=3`)
)
func NewCmdRolloutHistory(f *cmdutil.Factory, out io.Writer) *cobra.Command {