diff --git a/pkg/kubectl/cmd/util/factory_test.go b/pkg/kubectl/cmd/util/factory_test.go index 1bfa6565665..bfeaf5ee32d 100644 --- a/pkg/kubectl/cmd/util/factory_test.go +++ b/pkg/kubectl/cmd/util/factory_test.go @@ -746,12 +746,12 @@ func TestDiscoveryReplaceAliases(t *testing.T) { { name: "all-replacement", arg: "all", - expected: "pods,replicationcontrollers,services,statefulsets.apps,horizontalpodautoscalers.autoscaling,jobs.batch,cronjobs.batch,deployments.extensions,replicasets.extensions", + expected: "pods,replicationcontrollers,services,statefulsets.apps,horizontalpodautoscalers.autoscaling,jobs.batch,cronjobs.batch,daemonsets.extensions,deployments.extensions,replicasets.extensions", }, { name: "alias-in-comma-separated-arg", arg: "all,secrets", - expected: "pods,replicationcontrollers,services,statefulsets.apps,horizontalpodautoscalers.autoscaling,jobs.batch,cronjobs.batch,deployments.extensions,replicasets.extensions,secrets", + expected: "pods,replicationcontrollers,services,statefulsets.apps,horizontalpodautoscalers.autoscaling,jobs.batch,cronjobs.batch,daemonsets.extensions,deployments.extensions,replicasets.extensions,secrets", }, } diff --git a/pkg/kubectl/resource/categories.go b/pkg/kubectl/resource/categories.go index 98f797cb3a0..9c602a996c2 100644 --- a/pkg/kubectl/resource/categories.go +++ b/pkg/kubectl/resource/categories.go @@ -118,6 +118,7 @@ var legacyUserResources = []schema.GroupResource{ {Group: "autoscaling", Resource: "horizontalpodautoscalers"}, {Group: "batch", Resource: "jobs"}, {Group: "batch", Resource: "cronjobs"}, + {Group: "extensions", Resource: "daemonsets"}, {Group: "extensions", Resource: "deployments"}, {Group: "extensions", Resource: "replicasets"}, } diff --git a/pkg/kubectl/resource/categories_test.go b/pkg/kubectl/resource/categories_test.go index a977df751e1..69314d1848c 100644 --- a/pkg/kubectl/resource/categories_test.go +++ b/pkg/kubectl/resource/categories_test.go @@ -47,6 +47,7 @@ func TestCategoryExpansion(t *testing.T) { {Resource: "horizontalpodautoscalers", Group: "autoscaling"}, {Resource: "jobs", Group: "batch"}, {Resource: "cronjobs", Group: "batch"}, + {Resource: "daemonsets", Group: "extensions"}, {Resource: "deployments", Group: "extensions"}, {Resource: "replicasets", Group: "extensions"}, }, diff --git a/pkg/registry/extensions/daemonset/storage/storage.go b/pkg/registry/extensions/daemonset/storage/storage.go index 233b4d61e12..e4bdc28f0c9 100644 --- a/pkg/registry/extensions/daemonset/storage/storage.go +++ b/pkg/registry/extensions/daemonset/storage/storage.go @@ -67,6 +67,13 @@ func (r *REST) ShortNames() []string { return []string{"ds"} } +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 daemonset type StatusREST struct { store *genericregistry.Store