Define a mapping between REST resource name and kind/apiVersion

Allows clients to abstractly map user input to generic resource
paths as per docs/api-conventions.md

Extracted from #2000 and supports #1958
We need to have a priority order of RESTMappers for VersionAndKindForResource (i.e. if I give you "nodes" on the command line, I need to select the preferred API version that matches that, which should be v1beta1 Minions).  So the RESTMapper that gets chosen has to be in some order.  I'd prefer to hide the version ordering from calling code since they'd basically have to implement what "latest.Versions" give them.

I can certainly have latest construct a RESTMapper and store it as a constant, and make NewDefaultRESTMapper more generic and move it to a different package.  I originally had it in api/meta (it's related to api conventions).

----- Original Message -----
> > +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> > +See the License for the specific language governing permissions and
> > +limitations under the License.
> > +*/
> > +
> > +package latest
> > +
> > +import (
> > +	"fmt"
> > +	"strings"
> > +
> > +	"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
> > +	"github.com/GoogleCloudPlatform/kubernetes/pkg/api/meta"
> > +)
> > +
> > +// DefaultRESTMapper exposes mappings between the types defined in
> 
> I think a RESTMapping should be a thing that InterfacesFor() returns? It
> seems backwards to have RESTMapping depend on InterfacesFor(). If each
> versioned package supplied a RESTMapper, there'd be no dependency, right?
> 
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/GoogleCloudPlatform/kubernetes/pull/2059/files#r19571818