Merge pull request #28955 from dims/roadmap-extend-all

Automatic merge from submit-queue

Extend all to more resources

Added more things from the list here:
https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/cmd.go#L159

Note, did not add events as it did not seem useful to me. Since
this is just a list of messages generated by the system.

Related to a suggestion in issue #22337
This commit is contained in:
k8s-merge-robot
2016-08-01 10:07:01 -07:00
committed by GitHub
8 changed files with 151 additions and 46 deletions

View File

@@ -88,9 +88,6 @@ func enableVersions(externalVersions []unversioned.GroupVersion) error {
return nil
}
// userResources is a group of resources mostly used by a kubectl user
var userResources = []string{"rc", "svc", "pods", "pvc"}
func newRESTMapper(externalVersions []unversioned.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
@@ -116,11 +113,7 @@ func newRESTMapper(externalVersions []unversioned.GroupVersion) meta.RESTMapper
"ThirdPartyResourceData",
"ThirdPartyResourceList")
mapper := api.NewDefaultRESTMapper(externalVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
// setup aliases for groups of resources
mapper.AddResourceAlias("all", userResources...)
return mapper
return api.NewDefaultRESTMapper(externalVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
}
// InterfacesFor returns the default Codec and ResourceVersioner for a given version