add cronjobs to all

This commit is contained in:
deads2k 2017-07-20 15:36:19 -04:00
parent 088141ca3a
commit 1477b407c7
4 changed files with 11 additions and 2 deletions

View File

@ -746,12 +746,12 @@ func TestDiscoveryReplaceAliases(t *testing.T) {
{
name: "all-replacement",
arg: "all",
expected: "pods,replicationcontrollers,services,statefulsets.apps,horizontalpodautoscalers.autoscaling,jobs.batch,deployments.extensions,replicasets.extensions",
expected: "pods,replicationcontrollers,services,statefulsets.apps,horizontalpodautoscalers.autoscaling,jobs.batch,cronjobs.batch,deployments.extensions,replicasets.extensions",
},
{
name: "alias-in-comma-separated-arg",
arg: "all,secrets",
expected: "pods,replicationcontrollers,services,statefulsets.apps,horizontalpodautoscalers.autoscaling,jobs.batch,deployments.extensions,replicasets.extensions,secrets",
expected: "pods,replicationcontrollers,services,statefulsets.apps,horizontalpodautoscalers.autoscaling,jobs.batch,cronjobs.batch,deployments.extensions,replicasets.extensions,secrets",
},
}

View File

@ -117,6 +117,7 @@ var legacyUserResources = []schema.GroupResource{
{Group: "apps", Resource: "statefulsets"},
{Group: "autoscaling", Resource: "horizontalpodautoscalers"},
{Group: "batch", Resource: "jobs"},
{Group: "batch", Resource: "cronjobs"},
{Group: "extensions", Resource: "deployments"},
{Group: "extensions", Resource: "replicasets"},
}

View File

@ -46,6 +46,7 @@ func TestCategoryExpansion(t *testing.T) {
{Resource: "statefulsets", Group: "apps"},
{Resource: "horizontalpodautoscalers", Group: "autoscaling"},
{Resource: "jobs", Group: "batch"},
{Resource: "cronjobs", Group: "batch"},
{Resource: "deployments", Group: "extensions"},
{Resource: "replicasets", Group: "extensions"},
},

View File

@ -59,6 +59,13 @@ func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST) {
return &REST{store}, &StatusREST{store: &statusStore}
}
var _ rest.CategoriesProvider = &REST{}
// Categories implements the CategoriesProvider interface. Returns a list of categories a resource is part of.
func (r *REST) Categories() []string {
return []string{"all"}
}
// StatusREST implements the REST endpoint for changing the status of a resourcequota.
type StatusREST struct {
store *genericregistry.Store