mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #108489 from liggitt/category-cleanup
Clean up unused configurable categories
This commit is contained in:
commit
d70fa12759
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user