mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
Implement 'kubectl get ... -o wide'
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user