Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
dc3ee665
Commit
dc3ee665
authored
Jan 30, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #19970 from caesarxuchao/namespaced-cacher
Auto commit by PR queue bot
parents
958c1daa
ebcff4b5
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
44 additions
and
26 deletions
+44
-26
reststorage.go
examples/apiserver/rest/reststorage.go
+10
-1
create.go
pkg/api/rest/create.go
+6
-0
etcd.go
pkg/registry/configmap/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/controller/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/daemonset/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/deployment/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/endpoint/etcd/etcd.go
+1
-1
storage_factory.go
pkg/registry/generic/etcd/storage_factory.go
+3
-2
storage_decorator.go
pkg/registry/generic/storage_decorator.go
+3
-2
etcd.go
pkg/registry/horizontalpodautoscaler/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/ingress/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/job/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/limitrange/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/namespace/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/node/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/persistentvolume/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/persistentvolumeclaim/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/pod/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/podtemplate/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/resourcequota/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/secret/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/service/etcd/etcd.go
+1
-1
etcd.go
pkg/registry/serviceaccount/etcd/etcd.go
+1
-1
cacher.go
pkg/storage/cacher.go
+3
-2
No files found.
examples/apiserver/rest/reststorage.go
View file @
dc3ee665
...
@@ -35,8 +35,10 @@ type REST struct {
...
@@ -35,8 +35,10 @@ type REST struct {
func
NewREST
(
s
storage
.
Interface
,
storageDecorator
generic
.
StorageDecorator
)
*
REST
{
func
NewREST
(
s
storage
.
Interface
,
storageDecorator
generic
.
StorageDecorator
)
*
REST
{
prefix
:=
"/testtype"
prefix
:=
"/testtype"
newListFunc
:=
func
()
runtime
.
Object
{
return
&
testgroup
.
TestTypeList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
testgroup
.
TestTypeList
{}
}
// Usually you should reuse your RESTCreateStrategy.
strategy
:=
&
NotNamespaceScoped
{}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
testgroup
.
TestType
{},
prefix
,
false
,
newListFunc
)
s
,
100
,
&
testgroup
.
TestType
{},
prefix
,
strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
testgroup
.
TestType
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
testgroup
.
TestType
{}
},
// NewListFunc returns an object capable of storing results of an etcd list.
// 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
...
@@ -63,3 +65,10 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
}
}
return
&
REST
{
store
}
return
&
REST
{
store
}
}
}
type
NotNamespaceScoped
struct
{
}
func
(
*
NotNamespaceScoped
)
NamespaceScoped
()
bool
{
return
false
}
pkg/api/rest/create.go
View file @
dc3ee665
...
@@ -118,3 +118,9 @@ func objectMetaAndKind(typer runtime.ObjectTyper, obj runtime.Object) (*api.Obje
...
@@ -118,3 +118,9 @@ func objectMetaAndKind(typer runtime.ObjectTyper, obj runtime.Object) (*api.Obje
}
}
return
objectMeta
,
kind
,
nil
return
objectMeta
,
kind
,
nil
}
}
// NamespaceScopedStrategy has a method to tell if the object must be in a namespace.
type
NamespaceScopedStrategy
interface
{
// NamespaceScoped returns if the object must be in a namespace.
NamespaceScoped
()
bool
}
pkg/registry/configmap/etcd/etcd.go
View file @
dc3ee665
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
ConfigMapList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
ConfigMapList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
api
.
ConfigMap
{},
prefix
,
false
,
newListFunc
)
s
,
100
,
&
api
.
ConfigMap
{},
prefix
,
configmap
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
NewFunc
:
func
()
runtime
.
Object
{
...
...
pkg/registry/controller/etcd/etcd.go
View file @
dc3ee665
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
ReplicationControllerList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
ReplicationControllerList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
api
.
ReplicationController
{},
prefix
,
true
,
newListFunc
)
s
,
100
,
&
api
.
ReplicationController
{},
prefix
,
controller
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ReplicationController
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ReplicationController
{}
},
...
...
pkg/registry/daemonset/etcd/etcd.go
View file @
dc3ee665
...
@@ -39,7 +39,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
...
@@ -39,7 +39,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
newListFunc
:=
func
()
runtime
.
Object
{
return
&
extensions
.
DaemonSetList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
extensions
.
DaemonSetList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
extensions
.
DaemonSet
{},
prefix
,
false
,
newListFunc
)
s
,
100
,
&
extensions
.
DaemonSet
{},
prefix
,
daemonset
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
DaemonSet
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
DaemonSet
{}
},
...
...
pkg/registry/deployment/etcd/etcd.go
View file @
dc3ee665
...
@@ -62,7 +62,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
...
@@ -62,7 +62,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
newListFunc
:=
func
()
runtime
.
Object
{
return
&
extensions
.
DeploymentList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
extensions
.
DeploymentList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
extensions
.
Deployment
{},
prefix
,
false
,
newListFunc
)
s
,
100
,
&
extensions
.
Deployment
{},
prefix
,
deployment
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
Deployment
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
Deployment
{}
},
...
...
pkg/registry/endpoint/etcd/etcd.go
View file @
dc3ee665
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
EndpointsList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
EndpointsList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
1000
,
&
api
.
Endpoints
{},
prefix
,
true
,
newListFunc
)
s
,
1000
,
&
api
.
Endpoints
{},
prefix
,
endpoint
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Endpoints
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Endpoints
{}
},
...
...
pkg/registry/generic/etcd/storage_factory.go
View file @
dc3ee665
...
@@ -17,6 +17,7 @@ limitations under the License.
...
@@ -17,6 +17,7 @@ limitations under the License.
package
etcd
package
etcd
import
(
import
(
"k8s.io/kubernetes/pkg/api/rest"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/storage"
"k8s.io/kubernetes/pkg/storage"
etcdstorage
"k8s.io/kubernetes/pkg/storage/etcd"
etcdstorage
"k8s.io/kubernetes/pkg/storage/etcd"
...
@@ -28,9 +29,9 @@ func StorageWithCacher(
...
@@ -28,9 +29,9 @@ func StorageWithCacher(
capacity
int
,
capacity
int
,
objectType
runtime
.
Object
,
objectType
runtime
.
Object
,
resourcePrefix
string
,
resourcePrefix
string
,
namespaceScoped
bool
,
scopeStrategy
rest
.
NamespaceScopedStrategy
,
newListFunc
func
()
runtime
.
Object
)
storage
.
Interface
{
newListFunc
func
()
runtime
.
Object
)
storage
.
Interface
{
return
storage
.
NewCacher
(
return
storage
.
NewCacher
(
storageInterface
,
capacity
,
etcdstorage
.
APIObjectVersioner
{},
storageInterface
,
capacity
,
etcdstorage
.
APIObjectVersioner
{},
objectType
,
resourcePrefix
,
namespaceScoped
,
newListFunc
)
objectType
,
resourcePrefix
,
scopeStrategy
,
newListFunc
)
}
}
pkg/registry/generic/storage_decorator.go
View file @
dc3ee665
...
@@ -17,6 +17,7 @@ limitations under the License.
...
@@ -17,6 +17,7 @@ limitations under the License.
package
generic
package
generic
import
(
import
(
"k8s.io/kubernetes/pkg/api/rest"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/storage"
"k8s.io/kubernetes/pkg/storage"
)
)
...
@@ -28,7 +29,7 @@ type StorageDecorator func(
...
@@ -28,7 +29,7 @@ type StorageDecorator func(
capacity
int
,
capacity
int
,
objectType
runtime
.
Object
,
objectType
runtime
.
Object
,
resourcePrefix
string
,
resourcePrefix
string
,
namespaceScoped
bool
,
scopeStrategy
rest
.
NamespaceScopedStrategy
,
newListFunc
func
()
runtime
.
Object
)
storage
.
Interface
newListFunc
func
()
runtime
.
Object
)
storage
.
Interface
// Returns given 'storageInterface' without any decoration.
// Returns given 'storageInterface' without any decoration.
...
@@ -37,7 +38,7 @@ func UndecoratedStorage(
...
@@ -37,7 +38,7 @@ func UndecoratedStorage(
capacity
int
,
capacity
int
,
objectType
runtime
.
Object
,
objectType
runtime
.
Object
,
resourcePrefix
string
,
resourcePrefix
string
,
namespaceScoped
bool
,
scopeStrategy
rest
.
NamespaceScopedStrategy
,
newListFunc
func
()
runtime
.
Object
)
storage
.
Interface
{
newListFunc
func
()
runtime
.
Object
)
storage
.
Interface
{
return
storageInterface
return
storageInterface
}
}
pkg/registry/horizontalpodautoscaler/etcd/etcd.go
View file @
dc3ee665
...
@@ -38,7 +38,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
...
@@ -38,7 +38,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
newListFunc
:=
func
()
runtime
.
Object
{
return
&
extensions
.
HorizontalPodAutoscalerList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
extensions
.
HorizontalPodAutoscalerList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
extensions
.
HorizontalPodAutoscaler
{},
prefix
,
false
,
newListFunc
)
s
,
100
,
&
extensions
.
HorizontalPodAutoscaler
{},
prefix
,
horizontalpodautoscaler
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
HorizontalPodAutoscaler
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
HorizontalPodAutoscaler
{}
},
...
...
pkg/registry/ingress/etcd/etcd.go
View file @
dc3ee665
...
@@ -39,7 +39,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
...
@@ -39,7 +39,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
newListFunc
:=
func
()
runtime
.
Object
{
return
&
extensions
.
IngressList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
extensions
.
IngressList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
extensions
.
Ingress
{},
prefix
,
false
,
newListFunc
)
s
,
100
,
&
extensions
.
Ingress
{},
prefix
,
ingress
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
Ingress
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
Ingress
{}
},
...
...
pkg/registry/job/etcd/etcd.go
View file @
dc3ee665
...
@@ -39,7 +39,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
...
@@ -39,7 +39,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
newListFunc
:=
func
()
runtime
.
Object
{
return
&
extensions
.
JobList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
extensions
.
JobList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
extensions
.
Job
{},
prefix
,
false
,
newListFunc
)
s
,
100
,
&
extensions
.
Job
{},
prefix
,
job
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
Job
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
Job
{}
},
...
...
pkg/registry/limitrange/etcd/etcd.go
View file @
dc3ee665
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
LimitRangeList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
LimitRangeList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
api
.
LimitRange
{},
prefix
,
true
,
newListFunc
)
s
,
100
,
&
api
.
LimitRange
{},
prefix
,
limitrange
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
LimitRange
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
LimitRange
{}
},
...
...
pkg/registry/namespace/etcd/etcd.go
View file @
dc3ee665
...
@@ -53,7 +53,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
...
@@ -53,7 +53,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
NamespaceList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
NamespaceList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
api
.
Namespace
{},
prefix
,
true
,
newListFunc
)
s
,
100
,
&
api
.
Namespace
{},
prefix
,
namespace
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Namespace
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Namespace
{}
},
...
...
pkg/registry/node/etcd/etcd.go
View file @
dc3ee665
...
@@ -57,7 +57,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator, con
...
@@ -57,7 +57,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator, con
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
NodeList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
NodeList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
1000
,
&
api
.
Node
{},
prefix
,
false
,
newListFunc
)
s
,
1000
,
&
api
.
Node
{},
prefix
,
node
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Node
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Node
{}
},
...
...
pkg/registry/persistentvolume/etcd/etcd.go
View file @
dc3ee665
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolumeList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolumeList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
api
.
PersistentVolume
{},
prefix
,
true
,
newListFunc
)
s
,
100
,
&
api
.
PersistentVolume
{},
prefix
,
persistentvolume
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolume
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolume
{}
},
...
...
pkg/registry/persistentvolumeclaim/etcd/etcd.go
View file @
dc3ee665
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolumeClaimList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolumeClaimList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
api
.
PersistentVolumeClaim
{},
prefix
,
true
,
newListFunc
)
s
,
100
,
&
api
.
PersistentVolumeClaim
{},
prefix
,
persistentvolumeclaim
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolumeClaim
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolumeClaim
{}
},
...
...
pkg/registry/pod/etcd/etcd.go
View file @
dc3ee665
...
@@ -67,7 +67,7 @@ func NewStorage(
...
@@ -67,7 +67,7 @@ func NewStorage(
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
PodList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
PodList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
1000
,
&
api
.
Pod
{},
prefix
,
true
,
newListFunc
)
s
,
1000
,
&
api
.
Pod
{},
prefix
,
pod
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Pod
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Pod
{}
},
...
...
pkg/registry/podtemplate/etcd/etcd.go
View file @
dc3ee665
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
PodTemplateList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
PodTemplateList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
api
.
PodTemplate
{},
prefix
,
false
,
newListFunc
)
s
,
100
,
&
api
.
PodTemplate
{},
prefix
,
podtemplate
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PodTemplate
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PodTemplate
{}
},
...
...
pkg/registry/resourcequota/etcd/etcd.go
View file @
dc3ee665
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) (*R
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
ResourceQuotaList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
ResourceQuotaList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
api
.
ResourceQuota
{},
prefix
,
true
,
newListFunc
)
s
,
100
,
&
api
.
ResourceQuota
{},
prefix
,
resourcequota
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ResourceQuota
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ResourceQuota
{}
},
...
...
pkg/registry/secret/etcd/etcd.go
View file @
dc3ee665
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
SecretList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
SecretList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
api
.
Secret
{},
prefix
,
true
,
newListFunc
)
s
,
100
,
&
api
.
Secret
{},
prefix
,
secret
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Secret
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Secret
{}
},
...
...
pkg/registry/service/etcd/etcd.go
View file @
dc3ee665
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
ServiceList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
ServiceList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
api
.
Service
{},
prefix
,
false
,
newListFunc
)
s
,
100
,
&
api
.
Service
{},
prefix
,
service
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Service
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Service
{}
},
...
...
pkg/registry/serviceaccount/etcd/etcd.go
View file @
dc3ee665
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
...
@@ -37,7 +37,7 @@ func NewREST(s storage.Interface, storageDecorator generic.StorageDecorator) *RE
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
ServiceAccountList
{}
}
newListFunc
:=
func
()
runtime
.
Object
{
return
&
api
.
ServiceAccountList
{}
}
storageInterface
:=
storageDecorator
(
storageInterface
:=
storageDecorator
(
s
,
100
,
&
api
.
ServiceAccount
{},
prefix
,
true
,
newListFunc
)
s
,
100
,
&
api
.
ServiceAccount
{},
prefix
,
serviceaccount
.
Strategy
,
newListFunc
)
store
:=
&
etcdgeneric
.
Etcd
{
store
:=
&
etcdgeneric
.
Etcd
{
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ServiceAccount
{}
},
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ServiceAccount
{}
},
...
...
pkg/storage/cacher.go
View file @
dc3ee665
...
@@ -26,6 +26,7 @@ import (
...
@@ -26,6 +26,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/meta"
"k8s.io/kubernetes/pkg/api/meta"
"k8s.io/kubernetes/pkg/api/rest"
"k8s.io/kubernetes/pkg/client/cache"
"k8s.io/kubernetes/pkg/client/cache"
"k8s.io/kubernetes/pkg/conversion"
"k8s.io/kubernetes/pkg/conversion"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/runtime"
...
@@ -115,7 +116,7 @@ func NewCacher(
...
@@ -115,7 +116,7 @@ func NewCacher(
versioner
Versioner
,
versioner
Versioner
,
objectType
runtime
.
Object
,
objectType
runtime
.
Object
,
resourcePrefix
string
,
resourcePrefix
string
,
namespaceScoped
bool
,
scopeStrategy
rest
.
NamespaceScopedStrategy
,
newListFunc
func
()
runtime
.
Object
)
Interface
{
newListFunc
func
()
runtime
.
Object
)
Interface
{
config
:=
CacherConfig
{
config
:=
CacherConfig
{
CacheCapacity
:
capacity
,
CacheCapacity
:
capacity
,
...
@@ -125,7 +126,7 @@ func NewCacher(
...
@@ -125,7 +126,7 @@ func NewCacher(
ResourcePrefix
:
resourcePrefix
,
ResourcePrefix
:
resourcePrefix
,
NewListFunc
:
newListFunc
,
NewListFunc
:
newListFunc
,
}
}
if
namespaceScoped
{
if
scopeStrategy
.
NamespaceScoped
()
{
config
.
KeyFunc
=
func
(
obj
runtime
.
Object
)
(
string
,
error
)
{
config
.
KeyFunc
=
func
(
obj
runtime
.
Object
)
(
string
,
error
)
{
return
NamespaceKeyFunc
(
resourcePrefix
,
obj
)
return
NamespaceKeyFunc
(
resourcePrefix
,
obj
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment