mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Implement a RESTMappings method
With the introduction of batch/v1 and batch/v2alpha1, any MultiRESTMapper that has per groupversion mappers (as a naive discovery client would create) would end up being unable to call RESTMapping() on batch.Jobs. As we finish up discovery we will need to be able to choose prioritized RESTMappings based on the service discovery doc. This change implements RESTMappings(groupversion) which returns all possible RESTMappings for that kind. That allows a higher level call to prioritize the returned mappings by server or client preferred version.
This commit is contained in:
@@ -125,9 +125,7 @@ func checkErr(pref string, err error, handleErr func(string)) {
|
||||
handleErr(MultilineError(prefix, errs))
|
||||
}
|
||||
|
||||
if meta.IsNoResourceMatchError(err) {
|
||||
noMatch := err.(*meta.NoResourceMatchError)
|
||||
|
||||
if noMatch, ok := err.(*meta.NoResourceMatchError); ok {
|
||||
switch {
|
||||
case len(noMatch.PartialResource.Group) > 0 && len(noMatch.PartialResource.Version) > 0:
|
||||
handleErr(fmt.Sprintf("%sthe server doesn't have a resource type %q in group %q and version %q", pref, noMatch.PartialResource.Resource, noMatch.PartialResource.Group, noMatch.PartialResource.Version))
|
||||
|
||||
Reference in New Issue
Block a user