mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 21:21:14 +00:00
fix the namespaceScoped of cachers
This commit is contained in:
@@ -35,8 +35,10 @@ type REST struct {
|
||||
func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *REST {
|
||||
prefix := "/testtype"
|
||||
newListFunc := func() runtime.Object { return &testgroup.TestTypeList{} }
|
||||
// Usually you should reuse your RESTCreateStrategy.
|
||||
strategy := &NotNamespaceScoped{}
|
||||
storageInterface := storageDecorator(
|
||||
s, 100, &testgroup.TestType{}, prefix, false, newListFunc)
|
||||
s, 100, &testgroup.TestType{}, prefix, strategy, newListFunc)
|
||||
store := &etcdgeneric.Etcd{
|
||||
NewFunc: func() runtime.Object { return &testgroup.TestType{} },
|
||||
// NewListFunc returns an object capable of storing results of an etcd list.
|
||||
@@ -63,3 +65,10 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
|
||||
}
|
||||
return &REST{store}
|
||||
}
|
||||
|
||||
type NotNamespaceScoped struct {
|
||||
}
|
||||
|
||||
func (*NotNamespaceScoped) NamespaceScoped() bool {
|
||||
return false
|
||||
}
|
||||
|
Reference in New Issue
Block a user