Merge pull request #108489 from liggitt/category-cleanup

Clean up unused configurable categories
This commit is contained in:
Kubernetes Prow Robot 2022-03-04 12:54:52 -08:00 committed by GitHub
commit d70fa12759
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 27 deletions

View File

@ -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

View File

@ -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

View File

@ -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