Improve kubectl help with examples.

This commit is contained in:
Phillip Wittrock
2017-01-06 12:05:08 -08:00
parent 8ef6902516
commit dc2fffe5d4
10 changed files with 113 additions and 29 deletions

View File

@@ -22,13 +22,22 @@ import (
"github.com/spf13/cobra"
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
)
var (
delete_cluster_example = templates.Examples(`
# Delete the minikube cluster
kubectl config delete-cluster minikube`)
)
func NewCmdConfigDeleteCluster(out io.Writer, configAccess clientcmd.ConfigAccess) *cobra.Command {
cmd := &cobra.Command{
Use: "delete-cluster NAME",
Short: "Delete the specified cluster from the kubeconfig",
Use: "delete-cluster NAME",
Short: "Delete the specified cluster from the kubeconfig",
Long: "Delete the specified cluster from the kubeconfig",
Example: delete_cluster_example,
Run: func(cmd *cobra.Command, args []string) {
err := runDeleteCluster(out, configAccess, cmd)
cmdutil.CheckErr(err)