mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Improve kubectl help with examples.
This commit is contained in:
@@ -31,10 +31,16 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var longDescr = templates.LongDesc(`
|
||||
var (
|
||||
longDescr = templates.LongDesc(`
|
||||
Display addresses of the master and services with label kubernetes.io/cluster-service=true
|
||||
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.`)
|
||||
|
||||
clusterinfo_example = templates.Examples(`
|
||||
# Print the address of the master and cluster services
|
||||
kubectl cluster-info`)
|
||||
)
|
||||
|
||||
func NewCmdClusterInfo(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "cluster-info",
|
||||
@@ -42,6 +48,7 @@ func NewCmdClusterInfo(f cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
Aliases: []string{"clusterinfo"},
|
||||
Short: "Display cluster info",
|
||||
Long: longDescr,
|
||||
Example: clusterinfo_example,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
err := RunClusterInfo(f, out, cmd)
|
||||
cmdutil.CheckErr(err)
|
||||
|
||||
Reference in New Issue
Block a user