openshift/origin — pull request #476 by pweil- (2014-11-26 14:11:19+00:00)
Title: [WIP][DO NOT MERGE] Issue 398

This is meant to address #398, to add field selectors to the List method signatures. After a quick eval it looks like the places that had field selectors implemented were creating a map (`labels.Set`) based on fields on the object then doing a comparison with the `selector.Matches`.

This is an attempt to create the maps is a uniform way (currently it is up to the implementor to worry about case, which fields, etc). It also attempts to optimize the selector by first checking if it is empty so we don't create 1000s of maps on a list command that is using `labels.Everything`

This PR is just looking for buy in on the approach or alternatives to manually creating maps (and checking for empty selectors).

For reference, an existing impl:
https://github.com/pweil-/origin/blob/master/pkg/deploy/registry/etcd/etcd.go#L47