• Solly Ross's avatar
    Priority REST Mapper: Actually honor user choice · d1ec1b36
    Solly Ross authored
    RESTMapping takes a desired GroupKind, and a set of versions, and
    returns a rest mapper for the first matching version.  It also has a
    list of built-in discovered prioritized versions, to which it appends
    the user versions.
    
    However, when it goes to parse the versions, it parses them as
    GroupVersions.  Since only a version was passed, the group will be the
    empty group (""), which will only match rest mappings for the empty
    group, ergo, none of the user's versions will match if they are
    attempting a match for a non-emtpy-group GroupKind.
    
    This fixes that by taking the parsed GroupVersion, and overriding the
    Group with the Group from the passed-in GroupKind.
    d1ec1b36
priority.go 7.36 KB