From 616ac2f2d0bcf617b37ebeeb685529e67f9d5269 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Thu, 3 Mar 2022 09:27:38 -0500 Subject: [PATCH] Clean up unused configurable categories --- pkg/registry/apps/daemonset/storage/storage.go | 11 ++--------- pkg/registry/apps/deployment/storage/storage.go | 11 ++--------- pkg/registry/apps/replicaset/storage/storage.go | 11 ++--------- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/pkg/registry/apps/daemonset/storage/storage.go b/pkg/registry/apps/daemonset/storage/storage.go index ec337f19a77..33a24eb1217 100644 --- a/pkg/registry/apps/daemonset/storage/storage.go +++ b/pkg/registry/apps/daemonset/storage/storage.go @@ -35,7 +35,6 @@ import ( // REST implements a RESTStorage for DaemonSets type REST struct { *genericregistry.Store - categories []string } // NewREST returns a RESTStorage object that will work against DaemonSets. @@ -61,7 +60,7 @@ func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST, error) { statusStore.UpdateStrategy = daemonset.StatusStrategy statusStore.ResetFieldsStrategy = daemonset.StatusStrategy - return &REST{store, []string{"all"}}, &StatusREST{store: &statusStore}, nil + return &REST{store}, &StatusREST{store: &statusStore}, nil } // Implement ShortNamesProvider @@ -76,13 +75,7 @@ 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 r.categories -} - -// WithCategories sets categories for REST. -func (r *REST) WithCategories(categories []string) *REST { - r.categories = categories - return r + return []string{"all"} } // StatusREST implements the REST endpoint for changing the status of a daemonset diff --git a/pkg/registry/apps/deployment/storage/storage.go b/pkg/registry/apps/deployment/storage/storage.go index 773ec94b184..4a8eed1b9d9 100644 --- a/pkg/registry/apps/deployment/storage/storage.go +++ b/pkg/registry/apps/deployment/storage/storage.go @@ -87,7 +87,6 @@ func NewStorage(optsGetter generic.RESTOptionsGetter) (DeploymentStorage, error) // REST implements a RESTStorage for Deployments. type REST struct { *genericregistry.Store - categories []string } // NewREST returns a RESTStorage object that will work against deployments. @@ -112,7 +111,7 @@ func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST, *Rollbac statusStore := *store statusStore.UpdateStrategy = deployment.StatusStrategy statusStore.ResetFieldsStrategy = deployment.StatusStrategy - return &REST{store, []string{"all"}}, &StatusREST{store: &statusStore}, &RollbackREST{store: store}, nil + return &REST{store}, &StatusREST{store: &statusStore}, &RollbackREST{store: store}, nil } // Implement ShortNamesProvider @@ -128,13 +127,7 @@ 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 r.categories -} - -// WithCategories sets categories for REST. -func (r *REST) WithCategories(categories []string) *REST { - r.categories = categories - return r + return []string{"all"} } // StatusREST implements the REST endpoint for changing the status of a deployment diff --git a/pkg/registry/apps/replicaset/storage/storage.go b/pkg/registry/apps/replicaset/storage/storage.go index 11e51a300b4..d02ab479ea0 100644 --- a/pkg/registry/apps/replicaset/storage/storage.go +++ b/pkg/registry/apps/replicaset/storage/storage.go @@ -81,7 +81,6 @@ func NewStorage(optsGetter generic.RESTOptionsGetter) (ReplicaSetStorage, error) // REST implements a RESTStorage for ReplicaSet. type REST struct { *genericregistry.Store - categories []string } // NewREST returns a RESTStorage object that will work against ReplicaSet. @@ -108,7 +107,7 @@ func NewREST(optsGetter generic.RESTOptionsGetter) (*REST, *StatusREST, error) { statusStore.UpdateStrategy = replicaset.StatusStrategy statusStore.ResetFieldsStrategy = replicaset.StatusStrategy - return &REST{store, []string{"all"}}, &StatusREST{store: &statusStore}, nil + return &REST{store}, &StatusREST{store: &statusStore}, nil } // Implement ShortNamesProvider @@ -124,13 +123,7 @@ 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 r.categories -} - -// WithCategories sets categories for REST. -func (r *REST) WithCategories(categories []string) *REST { - r.categories = categories - return r + return []string{"all"} } // StatusREST implements the REST endpoint for changing the status of a ReplicaSet