Implement 'kubectl get ... -o wide'

This commit is contained in:
Janet Kuo
2015-06-29 11:36:06 -07:00
parent 686f5a3084
commit 682734bcc7
19 changed files with 179 additions and 102 deletions

View File

@@ -43,6 +43,9 @@ of the --template flag, you can filter the attributes of the fetched resource(s)
get_example = `// List all pods in ps output format.
$ kubectl get pods
// List all pods in ps output format with more information (such as node name).
$ kubectl get pods -o wide
// List a single replication controller with specified NAME in ps output format.
$ kubectl get replicationcontroller web
@@ -55,18 +58,18 @@ $ kubectl get -o template web-pod-13je7 --template={{.status.phase}} --api-versi
// List all replication controllers and services together in ps output format.
$ kubectl get rc,services
// List one or more resources by their type and names
// List one or more resources by their type and names.
$ kubectl get rc/web service/frontend pods/web-pod-13je7`
)
// NewCmdGet creates a command object for the generic "get" action, which
// retrieves one or more resources from a server.
func NewCmdGet(f *cmdutil.Factory, out io.Writer) *cobra.Command {
p := kubectl.NewHumanReadablePrinter(false, false, []string{})
p := kubectl.NewHumanReadablePrinter(false, false, false, []string{})
validArgs := p.HandledResources()
cmd := &cobra.Command{
Use: "get [(-o|--output=)json|yaml|template|...] (RESOURCE [NAME] | RESOURCE/NAME ...)",
Use: "get [(-o|--output=)json|yaml|template|wide|...] (RESOURCE [NAME] | RESOURCE/NAME ...)",
Short: "Display one or many resources",
Long: get_long,
Example: get_example,