mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +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:
@@ -21,6 +21,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/renstrom/dedent"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
|
||||
@@ -36,11 +37,13 @@ type createContextOptions struct {
|
||||
namespace util.StringFlag
|
||||
}
|
||||
|
||||
const (
|
||||
create_context_long = `Sets a context entry in kubeconfig
|
||||
Specifying a name that already exists will merge new fields on top of existing values for those fields.`
|
||||
create_context_example = `# Set the user field on the gce context entry without touching other values
|
||||
kubectl config set-context gce --user=cluster-admin`
|
||||
var (
|
||||
create_context_long = dedent.Dedent(`
|
||||
Sets a context entry in kubeconfig
|
||||
Specifying a name that already exists will merge new fields on top of existing values for those fields.`)
|
||||
create_context_example = dedent.Dedent(`
|
||||
# Set the user field on the gce context entry without touching other values
|
||||
kubectl config set-context gce --user=cluster-admin`)
|
||||
)
|
||||
|
||||
func NewCmdConfigSetContext(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command {
|
||||
|
||||
Reference in New Issue
Block a user