Code change:
return &Result{visitor: VisitorList(visitors), sources: visitors} } <del> // visit single item specified by name if len(b.name) != 0 { </del> <ins> // visit items specified by name if len(b.names) != 0 { isSingular := len(b.names) == 1 </ins> if len(b.paths) != 0 { <del> return &Result{singular: true, err: fmt.Errorf("when paths, URLs, or stdin is provided as input, you may not specify a resource by arguments as well")} </del> <ins> return &Result{singular: isSingular, err: fmt.Errorf("when paths, URLs, or stdin is provided as input, you may not specify a resource by arguments as well")} </ins> } if len(b.resources) == 0 { <del> return &Result{singular: true, err: fmt.Errorf("you must provide a resource and a resource name together")} </del> <ins> return &Result{singular: isSingular, err: fmt.Errorf("you must provide a resource and a resource name together")} </ins> } if len(b.resources) > 1 { <del> return &Result{singular: true, err: fmt.Errorf("you must specify only one resource")} </del> <ins> return &Result{singular: isSingular, err: fmt.Errorf("you must specify only one resource")} </ins> } mappings, err := b.resourceMappings() if err != nil { <del> return &Result{singular: true, err: err} </del> <ins> return &Result{singular: isSingular, err: err} </ins> } mapping := mappings[0] <ins> client, err := b.mapper.ClientForMapping(mapping) if err != nil { return &Result{err: err} } selectorNamespace := b.namespace </ins> if mapping.Scope.Name() != meta.RESTScopeNameNamespace { <del> b.namespace = "" </del> <ins> selectorNamespace = "" </ins> } else { if len(b.namespace) == 0 { <del> return &Result{singular: true, err: fmt.Errorf("namespace may not be empty when retrieving a resource by name")} </del> <ins> return &Result{singular: isSingular, err: fmt.Errorf("namespace may not be empty when retrieving a resource by name")} </ins> } } <del> client, err := b.mapper.ClientForMapping(mapping) if err != nil { return &Result{singular: true, err: err} } info := NewInfo(client, mappings[0], b.namespace, b.name) if err := info.Get(); err != nil { return &Result{singular: true, err: err} </del> <ins> visitors := []Visitor{} for _, name := range b.names { info := NewInfo(client, mapping, selectorNamespace, name) if err := info.Get(); err != nil { return &Result{singular: isSingular, err: err} } visitors = append(visitors, info) </ins> } <del> return &Result{singular: true, visitor: info, sources: []Visitor{info}} </del> <ins> return &Result{singular: isSingular, visitor: VisitorList(visitors), sources: visitors} </ins> } // visit items specified by paths

Related discussion:
text: Currently, it could not delete multiple pods at once, need to delete them one by one, it's very inconvenient if I have tons of pods to delete. Unlike docker, docker can multiple stop/rm containers/images at once.
This is possible using label selectors as of , which is better if you have tons of pods.
I agree that using label selector is better to delete all of pods under the label. But to delete multile pods at once is still usable: I just want to delete 1/2 pods under the label, label selector will not work selector could not span over other selectors or pods Another reason is docker rm/stop x y z works, I will wonder why kubectl cannot. This is not urgent, but I hope it can be implemented.
I agree. Thanks for the suggestion.
Would this be a suitable task for someone new to k8s development? If so, I'd be willing to take a look at this, if someone could provide a couple of hints where to start.
Further to my last message, I have a functional work in progress I would like to share, if anyone is interested?
PRs are welcome. See
Yes, this is a reasonable place to start. Since its in the client, you won't get much orientation to the core server code, but it will be a good place to orient to the client side API. There us also prior art that you can model off of. The kubectl create ... command already supports multiple resources. A good command to adapter would be the 'label' command. You can find it in Many thanks in advance! Brendan On Feb 19, 2015 8:21 AM, "Eric Tune" wrote: