Use our own normalizers for cmd examples and descriptions

This commit is contained in:
Fabiano Franz
2016-10-07 19:24:42 -03:00
parent 6f66c0eafa
commit f6d1ac72a0
58 changed files with 427 additions and 406 deletions

View File

@@ -24,11 +24,11 @@ import (
"path/filepath"
"strings"
"github.com/renstrom/dedent"
"github.com/spf13/cobra"
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
clientcmdapi "k8s.io/kubernetes/pkg/client/unversioned/clientcmd/api"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/util/flag"
)
@@ -55,23 +55,23 @@ const (
)
var (
create_authinfo_long = fmt.Sprintf(`
Sets a user entry in kubeconfig
Specifying a name that already exists will merge new fields on top of existing values.
create_authinfo_long = fmt.Sprintf(templates.LongDesc(`
Sets a user entry in kubeconfig
Client-certificate flags:
--%v=certfile --%v=keyfile
Specifying a name that already exists will merge new fields on top of existing values.
Bearer token flags:
--%v=bearer_token
Client-certificate flags:
--%v=certfile --%v=keyfile
Basic auth flags:
--%v=basic_user --%v=basic_password
Bearer token flags:
--%v=bearer_token
Bearer token and basic auth are mutually exclusive.
`, clientcmd.FlagCertFile, clientcmd.FlagKeyFile, clientcmd.FlagBearerToken, clientcmd.FlagUsername, clientcmd.FlagPassword)
Basic auth flags:
--%v=basic_user --%v=basic_password
create_authinfo_example = dedent.Dedent(`
Bearer token and basic auth are mutually exclusive.`), clientcmd.FlagCertFile, clientcmd.FlagKeyFile, clientcmd.FlagBearerToken, clientcmd.FlagUsername, clientcmd.FlagPassword)
create_authinfo_example = templates.Examples(`
# Set only the "client-key" field on the "cluster-admin"
# entry, without touching other values:
kubectl config set-credentials cluster-admin --client-key=~/.kube/admin.key