Fix md generation for kubectl docs

Display usage string, not long help, as code, remove angle brackets from
output (.md interprets as tags and hides).
This commit is contained in:
Jeff Lowdermilk
2015-03-11 10:22:08 -07:00
parent 7d53425bbc
commit a5746c9a0e
60 changed files with 378 additions and 240 deletions

View File

@@ -39,18 +39,27 @@ type createClusterOptions struct {
embedCAData util.BoolFlag
}
const (
create_cluster_long = `Sets a cluster entry in .kubeconfig.
Specifying a name that already exists will merge new fields on top of existing values for those fields.`
create_cluster_example = `// Set only the server field on the e2e cluster entry without touching other values.
$ kubectl config set-cluster e2e --server=https://1.2.3.4
// Embed certificate authority data for the e2e cluster entry
$ kubectl config set-cluster e2e --certificate-authority=~/.kube/e2e/kubernetes.ca.crt
// Disable cert checking for the dev cluster entry
$ kubectl config set-cluster e2e --insecure-skip-tls-verify=true`
)
func NewCmdConfigSetCluster(out io.Writer, pathOptions *pathOptions) *cobra.Command {
options := &createClusterOptions{pathOptions: pathOptions}
cmd := &cobra.Command{
Use: fmt.Sprintf("set-cluster name [--%v=server] [--%v=path/to/certficate/authority] [--%v=apiversion] [--%v=true]", clientcmd.FlagAPIServer, clientcmd.FlagCAFile, clientcmd.FlagAPIVersion, clientcmd.FlagInsecure),
Short: "Sets a cluster entry in .kubeconfig",
Long: `Sets a cluster entry in .kubeconfig
Specifying a name that already exists will merge new fields on top of existing values for those fields.
e.g.
kubectl config set-cluster e2e --certificate-authority=~/.kube/e2e/.kubernetes.ca.cert
only sets the certificate-authority field on the e2e cluster entry without touching other values.
`,
Use: fmt.Sprintf("set-cluster NAME [--%v=server] [--%v=path/to/certficate/authority] [--%v=apiversion] [--%v=true]", clientcmd.FlagAPIServer, clientcmd.FlagCAFile, clientcmd.FlagAPIVersion, clientcmd.FlagInsecure),
Short: "Sets a cluster entry in .kubeconfig",
Long: create_cluster_long,
Example: create_cluster_example,
Run: func(cmd *cobra.Command, args []string) {
if !options.complete(cmd) {
return