Merge pull request #43622 from deads2k/cli-10-category

Automatic merge from submit-queue (batch tested with PRs 42087, 43383, 43622)

move category expansion out of restmapper

RESTMapping isn't related to CategoryExpansion (the bit that expands "all" into items to be RESTMapped).  This provides that separation and simplifies the RESTMapper interface.

@kubernetes/sig-cli-pr-reviews
This commit is contained in:
Kubernetes Submit Queue
2017-03-27 16:08:20 -07:00
committed by GitHub
51 changed files with 298 additions and 245 deletions

View File

@@ -83,9 +83,6 @@ func enableVersions(externalVersions []schema.GroupVersion) error {
return nil
}
// userResources is a group of resources mostly used by a kubectl user
var userResources = []string{"svc"}
func newRESTMapper(externalVersions []schema.GroupVersion) meta.RESTMapper {
// the list of kinds that are scoped at the root of the api hierarchy
// if a kind is not enumerated here, it is assumed to have a namespace scope
@@ -100,8 +97,6 @@ func newRESTMapper(externalVersions []schema.GroupVersion) meta.RESTMapper {
"Status")
mapper := meta.NewDefaultRESTMapperFromScheme(externalVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped, core.Scheme)
// setup aliases for groups of resources
mapper.AddResourceAlias("all", userResources...)
return mapper
}