[WIP] Add selector filter to 'cli delete' cmd

Most of these changes will probably go UPSTREAM, unless I'm proven wrong. Let's discuss here first.

@smarterclayton @fabianofranz feedback would be appreciated.

- [x] `openshift cli delete -l template=guestbook-example pods redis-master`
- [ ] `openshift cli delete -l template=guestbook-example pods`
- [ ] `openshift cli delete -l template=guestbook-example pods,services`
This is already being done upstream by Dario, see https://github.com/GoogleCloudPlatform/kubernetes/pull/2751

----- Original Message -----
> > +			item, err := storage.Get(api.WithNamespaceDefaultIfNone(ctx), parts[1])
> > +			if err != nil {
> > +				errorJSON(err, h.codec, w)
> > +				return
> > +			}
> > +			accessor, err := meta.Accessor(item)
> > +			if err != nil {
> > +				errorJSON(err, h.codec, w)
> > +				return
> > +			}
> > +			if !label.Matches(labels.Set(accessor.Labels())) {
> > +				err = fmt.Errorf("%v \"%v\" doesn't match specified selector \"%v\"",
> > accessor.Kind(), accessor.Name(), label.String())
> > +				errorJSON(err, h.codec, w)
> > +				return
> > +			}
> > +			out, err := storage.Delete(api.WithNamespaceDefaultIfNone(ctx),
> > parts[1])
> 
> I need to filter first, as seen above, unless I want to add `labels` as
> parameter to every `Delete()` implementation of the RESTStorage interface.
> Is this a good way?
> 
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/openshift/origin/pull/574/files#r21883734