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
2eda19da
Commit
2eda19da
authored
Jul 19, 2017
by
Shiyang Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix NotFound errors do not line up with API endpoint's group version
parent
c75d3028
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
345 additions
and
259 deletions
+345
-259
etcd.go
federation/registry/cluster/etcd/etcd.go
+6
-6
storage.go
...ion/externaladmissionhookconfiguration/storage/storage.go
+3
-3
storage.go
...nregistration/initializerconfiguration/storage/storage.go
+3
-3
storage.go
pkg/registry/apps/controllerrevision/storage/storage.go
+6
-6
storage.go
pkg/registry/apps/statefulset/storage/storage.go
+6
-6
storage.go
...ry/autoscaling/horizontalpodautoscaler/storage/storage.go
+6
-6
storage.go
pkg/registry/batch/cronjob/storage/storage.go
+8
-9
storage.go
pkg/registry/batch/job/storage/storage.go
+6
-6
storage.go
pkg/registry/certificates/certificates/storage/storage.go
+6
-6
storage.go
pkg/registry/core/configmap/storage/storage.go
+6
-6
storage.go
pkg/registry/core/endpoint/storage/storage.go
+6
-6
storage.go
pkg/registry/core/event/storage/storage.go
+2
-2
storage.go
pkg/registry/core/limitrange/storage/storage.go
+6
-6
storage.go
pkg/registry/core/namespace/storage/storage.go
+6
-6
storage.go
pkg/registry/core/node/storage/storage.go
+6
-6
storage.go
pkg/registry/core/persistentvolume/storage/storage.go
+6
-6
storage.go
pkg/registry/core/persistentvolumeclaim/storage/storage.go
+6
-6
storage.go
pkg/registry/core/pod/storage/storage.go
+6
-6
storage.go
pkg/registry/core/podtemplate/storage/storage.go
+6
-6
storage.go
pkg/registry/core/replicationcontroller/storage/storage.go
+6
-6
storage.go
pkg/registry/core/resourcequota/storage/storage.go
+6
-6
storage.go
pkg/registry/core/secret/storage/storage.go
+6
-6
storage.go
pkg/registry/core/service/storage/storage.go
+6
-6
storage.go
pkg/registry/core/serviceaccount/storage/storage.go
+6
-6
storage.go
pkg/registry/extensions/daemonset/storage/storage.go
+6
-6
storage.go
pkg/registry/extensions/deployment/storage/storage.go
+6
-6
storage.go
pkg/registry/extensions/ingress/storage/storage.go
+6
-6
storage.go
pkg/registry/extensions/networkpolicy/storage/storage.go
+6
-6
storage.go
pkg/registry/extensions/podsecuritypolicy/storage/storage.go
+6
-6
storage.go
pkg/registry/extensions/replicaset/storage/storage.go
+6
-6
storage.go
pkg/registry/networking/networkpolicy/storage/storage.go
+6
-6
storage.go
pkg/registry/policy/poddisruptionbudget/storage/storage.go
+6
-6
storage.go
pkg/registry/rbac/clusterrole/storage/storage.go
+6
-6
storage.go
pkg/registry/rbac/clusterrolebinding/storage/storage.go
+6
-6
storage.go
pkg/registry/rbac/role/storage/storage.go
+6
-6
storage.go
pkg/registry/rbac/rolebinding/storage/storage.go
+6
-6
storage.go
pkg/registry/scheduling/priorityclass/storage/storage.go
+6
-6
storage.go
pkg/registry/settings/podpreset/storage/storage.go
+6
-6
storage.go
pkg/registry/storage/storageclass/storage/storage.go
+6
-6
etcd.go
...iextensions-apiserver/pkg/registry/customresource/etcd.go
+2
-2
etcd.go
...s-apiserver/pkg/registry/customresourcedefinition/etcd.go
+5
-5
store.go
...c/k8s.io/apiserver/pkg/registry/generic/registry/store.go
+0
-0
store_test.go
....io/apiserver/pkg/registry/generic/registry/store_test.go
+97
-10
etcd.go
...s.io/kube-aggregator/pkg/registry/apiservice/etcd/etcd.go
+5
-5
etcd.go
...s.io/sample-apiserver/pkg/registry/wardle/fischer/etcd.go
+5
-5
etcd.go
...s.io/sample-apiserver/pkg/registry/wardle/flunder/etcd.go
+5
-5
No files found.
federation/registry/cluster/etcd/etcd.go
View file @
2eda19da
...
...
@@ -48,12 +48,12 @@ func (r *StatusREST) Update(ctx genericapirequest.Context, name string, objInfo
// NewREST returns a RESTStorage object that will work against clusters.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
federation
.
Cluster
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
federation
.
ClusterList
{}
},
PredicateFunc
:
cluster
.
MatchCluster
,
QualifiedResource
:
federation
.
Resource
(
"clusters"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"clusters"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
federation
.
Cluster
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
federation
.
ClusterList
{}
},
PredicateFunc
:
cluster
.
MatchCluster
,
Default
QualifiedResource
:
federation
.
Resource
(
"clusters"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"clusters"
),
CreateStrategy
:
cluster
.
Strategy
,
UpdateStrategy
:
cluster
.
Strategy
,
...
...
pkg/registry/admissionregistration/externaladmissionhookconfiguration/storage/storage.go
View file @
2eda19da
...
...
@@ -40,9 +40,9 @@ func NewREST(optsGetter generic.RESTOptionsGetter) *REST {
ObjectNameFunc
:
func
(
obj
runtime
.
Object
)
(
string
,
error
)
{
return
obj
.
(
*
admissionregistration
.
ExternalAdmissionHookConfiguration
)
.
Name
,
nil
},
PredicateFunc
:
externaladmissionhookconfiguration
.
MatchExternalAdmissionHookConfiguration
,
QualifiedResource
:
admissionregistration
.
Resource
(
"externaladmissionhookconfigurations"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"externaladmissionhookconfigurations"
),
PredicateFunc
:
externaladmissionhookconfiguration
.
MatchExternalAdmissionHookConfiguration
,
Default
QualifiedResource
:
admissionregistration
.
Resource
(
"externaladmissionhookconfigurations"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"externaladmissionhookconfigurations"
),
CreateStrategy
:
externaladmissionhookconfiguration
.
Strategy
,
UpdateStrategy
:
externaladmissionhookconfiguration
.
Strategy
,
...
...
pkg/registry/admissionregistration/initializerconfiguration/storage/storage.go
View file @
2eda19da
...
...
@@ -40,9 +40,9 @@ func NewREST(optsGetter generic.RESTOptionsGetter) *REST {
ObjectNameFunc
:
func
(
obj
runtime
.
Object
)
(
string
,
error
)
{
return
obj
.
(
*
admissionregistration
.
InitializerConfiguration
)
.
Name
,
nil
},
PredicateFunc
:
initializerconfiguration
.
MatchInitializerConfiguration
,
QualifiedResource
:
admissionregistration
.
Resource
(
"initializerconfigurations"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"initializerconfigurations"
),
PredicateFunc
:
initializerconfiguration
.
MatchInitializerConfiguration
,
Default
QualifiedResource
:
admissionregistration
.
Resource
(
"initializerconfigurations"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"initializerconfigurations"
),
CreateStrategy
:
initializerconfiguration
.
Strategy
,
UpdateStrategy
:
initializerconfiguration
.
Strategy
,
...
...
pkg/registry/apps/controllerrevision/storage/storage.go
View file @
2eda19da
...
...
@@ -34,12 +34,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work with ControllerRevision objects.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
apps
.
ControllerRevision
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
apps
.
ControllerRevisionList
{}
},
PredicateFunc
:
controllerrevision
.
MatchControllerRevision
,
QualifiedResource
:
apps
.
Resource
(
"controllerrevisions"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"controllerrevisions"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
apps
.
ControllerRevision
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
apps
.
ControllerRevisionList
{}
},
PredicateFunc
:
controllerrevision
.
MatchControllerRevision
,
Default
QualifiedResource
:
apps
.
Resource
(
"controllerrevisions"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"controllerrevisions"
),
CreateStrategy
:
controllerrevision
.
Strategy
,
UpdateStrategy
:
controllerrevision
.
Strategy
,
...
...
pkg/registry/apps/statefulset/storage/storage.go
View file @
2eda19da
...
...
@@ -37,12 +37,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against replication controllers.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
appsapi
.
StatefulSet
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
appsapi
.
StatefulSetList
{}
},
PredicateFunc
:
statefulset
.
MatchStatefulSet
,
QualifiedResource
:
appsapi
.
Resource
(
"statefulsets"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"statefulsets"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
appsapi
.
StatefulSet
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
appsapi
.
StatefulSetList
{}
},
PredicateFunc
:
statefulset
.
MatchStatefulSet
,
Default
QualifiedResource
:
appsapi
.
Resource
(
"statefulsets"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"statefulsets"
),
CreateStrategy
:
statefulset
.
Strategy
,
UpdateStrategy
:
statefulset
.
Strategy
,
...
...
pkg/registry/autoscaling/horizontalpodautoscaler/storage/storage.go
View file @
2eda19da
...
...
@@ -36,12 +36,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against horizontal pod autoscalers.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
autoscaling
.
HorizontalPodAutoscaler
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
autoscaling
.
HorizontalPodAutoscalerList
{}
},
PredicateFunc
:
horizontalpodautoscaler
.
MatchAutoscaler
,
QualifiedResource
:
autoscaling
.
Resource
(
"horizontalpodautoscalers"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"horizontalpodautoscalers"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
autoscaling
.
HorizontalPodAutoscaler
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
autoscaling
.
HorizontalPodAutoscalerList
{}
},
PredicateFunc
:
horizontalpodautoscaler
.
MatchAutoscaler
,
Default
QualifiedResource
:
autoscaling
.
Resource
(
"horizontalpodautoscalers"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"horizontalpodautoscalers"
),
CreateStrategy
:
horizontalpodautoscaler
.
Strategy
,
UpdateStrategy
:
horizontalpodautoscaler
.
Strategy
,
...
...
pkg/registry/batch/cronjob/storage/storage.go
View file @
2eda19da
...
...
@@ -37,15 +37,14 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against CronJobs.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
batch
.
CronJob
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
batch
.
CronJobList
{}
},
QualifiedResource
:
batch
.
Resource
(
"cronjobs"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"cronjobs"
),
CreateStrategy
:
cronjob
.
Strategy
,
UpdateStrategy
:
cronjob
.
Strategy
,
DeleteStrategy
:
cronjob
.
Strategy
,
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
batch
.
CronJob
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
batch
.
CronJobList
{}
},
DefaultQualifiedResource
:
batch
.
Resource
(
"cronjobs"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"cronjobs"
),
CreateStrategy
:
cronjob
.
Strategy
,
UpdateStrategy
:
cronjob
.
Strategy
,
DeleteStrategy
:
cronjob
.
Strategy
,
}
options
:=
&
generic
.
StoreOptions
{
RESTOptions
:
optsGetter
}
if
err
:=
store
.
CompleteWithOptions
(
options
);
err
!=
nil
{
...
...
pkg/registry/batch/job/storage/storage.go
View file @
2eda19da
...
...
@@ -52,12 +52,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against Jobs.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
batch
.
Job
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
batch
.
JobList
{}
},
PredicateFunc
:
job
.
MatchJob
,
QualifiedResource
:
batch
.
Resource
(
"jobs"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"jobs"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
batch
.
Job
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
batch
.
JobList
{}
},
PredicateFunc
:
job
.
MatchJob
,
Default
QualifiedResource
:
batch
.
Resource
(
"jobs"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"jobs"
),
CreateStrategy
:
job
.
Strategy
,
UpdateStrategy
:
job
.
Strategy
,
...
...
pkg/registry/certificates/certificates/storage/storage.go
View file @
2eda19da
...
...
@@ -36,12 +36,12 @@ type REST struct {
// NewREST returns a registry which will store CertificateSigningRequest in the given helper
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
,
*
ApprovalREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
certificates
.
CertificateSigningRequest
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
certificates
.
CertificateSigningRequestList
{}
},
PredicateFunc
:
csrregistry
.
Matcher
,
QualifiedResource
:
certificates
.
Resource
(
"certificatesigningrequests"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"certificatesigningrequests"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
certificates
.
CertificateSigningRequest
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
certificates
.
CertificateSigningRequestList
{}
},
PredicateFunc
:
csrregistry
.
Matcher
,
Default
QualifiedResource
:
certificates
.
Resource
(
"certificatesigningrequests"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"certificatesigningrequests"
),
CreateStrategy
:
csrregistry
.
Strategy
,
UpdateStrategy
:
csrregistry
.
Strategy
,
...
...
pkg/registry/core/configmap/storage/storage.go
View file @
2eda19da
...
...
@@ -34,12 +34,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work with ConfigMap objects.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ConfigMap
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ConfigMapList
{}
},
PredicateFunc
:
configmap
.
MatchConfigMap
,
QualifiedResource
:
api
.
Resource
(
"configmaps"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"configmaps"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ConfigMap
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ConfigMapList
{}
},
PredicateFunc
:
configmap
.
MatchConfigMap
,
Default
QualifiedResource
:
api
.
Resource
(
"configmaps"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"configmaps"
),
CreateStrategy
:
configmap
.
Strategy
,
UpdateStrategy
:
configmap
.
Strategy
,
...
...
pkg/registry/core/endpoint/storage/storage.go
View file @
2eda19da
...
...
@@ -33,12 +33,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against endpoints.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Endpoints
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
EndpointsList
{}
},
PredicateFunc
:
endpoint
.
MatchEndpoints
,
QualifiedResource
:
api
.
Resource
(
"endpoints"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"endpoints"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Endpoints
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
EndpointsList
{}
},
PredicateFunc
:
endpoint
.
MatchEndpoints
,
Default
QualifiedResource
:
api
.
Resource
(
"endpoints"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"endpoints"
),
CreateStrategy
:
endpoint
.
Strategy
,
UpdateStrategy
:
endpoint
.
Strategy
,
...
...
pkg/registry/core/event/storage/storage.go
View file @
2eda19da
...
...
@@ -50,8 +50,8 @@ func NewREST(optsGetter generic.RESTOptionsGetter, ttl uint64) *REST {
TTLFunc
:
func
(
runtime
.
Object
,
uint64
,
bool
)
(
uint64
,
error
)
{
return
ttl
,
nil
},
QualifiedResource
:
resource
,
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
resource
.
Resource
),
Default
QualifiedResource
:
resource
,
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
resource
.
Resource
),
CreateStrategy
:
event
.
Strategy
,
UpdateStrategy
:
event
.
Strategy
,
...
...
pkg/registry/core/limitrange/storage/storage.go
View file @
2eda19da
...
...
@@ -33,12 +33,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against horizontal pod autoscalers.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
LimitRange
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
LimitRangeList
{}
},
PredicateFunc
:
limitrange
.
MatchLimitRange
,
QualifiedResource
:
api
.
Resource
(
"limitranges"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"limitranges"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
LimitRange
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
LimitRangeList
{}
},
PredicateFunc
:
limitrange
.
MatchLimitRange
,
Default
QualifiedResource
:
api
.
Resource
(
"limitranges"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"limitranges"
),
CreateStrategy
:
limitrange
.
Strategy
,
UpdateStrategy
:
limitrange
.
Strategy
,
...
...
pkg/registry/core/namespace/storage/storage.go
View file @
2eda19da
...
...
@@ -54,12 +54,12 @@ type FinalizeREST struct {
// NewREST returns a RESTStorage object that will work against namespaces.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
,
*
FinalizeREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Namespace
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
NamespaceList
{}
},
PredicateFunc
:
namespace
.
MatchNamespace
,
QualifiedResource
:
api
.
Resource
(
"namespaces"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"namespaces"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Namespace
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
NamespaceList
{}
},
PredicateFunc
:
namespace
.
MatchNamespace
,
Default
QualifiedResource
:
api
.
Resource
(
"namespaces"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"namespaces"
),
CreateStrategy
:
namespace
.
Strategy
,
UpdateStrategy
:
namespace
.
Strategy
,
...
...
pkg/registry/core/node/storage/storage.go
View file @
2eda19da
...
...
@@ -73,12 +73,12 @@ func (r *StatusREST) Update(ctx genericapirequest.Context, name string, objInfo
// NewStorage returns a NodeStorage object that will work against nodes.
func
NewStorage
(
optsGetter
generic
.
RESTOptionsGetter
,
kubeletClientConfig
client
.
KubeletClientConfig
,
proxyTransport
http
.
RoundTripper
)
(
*
NodeStorage
,
error
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Node
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
NodeList
{}
},
PredicateFunc
:
node
.
MatchNode
,
QualifiedResource
:
api
.
Resource
(
"nodes"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"nodes"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Node
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
NodeList
{}
},
PredicateFunc
:
node
.
MatchNode
,
Default
QualifiedResource
:
api
.
Resource
(
"nodes"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"nodes"
),
CreateStrategy
:
node
.
Strategy
,
UpdateStrategy
:
node
.
Strategy
,
...
...
pkg/registry/core/persistentvolume/storage/storage.go
View file @
2eda19da
...
...
@@ -35,12 +35,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against persistent volumes.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolume
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolumeList
{}
},
PredicateFunc
:
persistentvolume
.
MatchPersistentVolumes
,
QualifiedResource
:
api
.
Resource
(
"persistentvolumes"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"persistentvolumes"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolume
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolumeList
{}
},
PredicateFunc
:
persistentvolume
.
MatchPersistentVolumes
,
Default
QualifiedResource
:
api
.
Resource
(
"persistentvolumes"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"persistentvolumes"
),
CreateStrategy
:
persistentvolume
.
Strategy
,
UpdateStrategy
:
persistentvolume
.
Strategy
,
...
...
pkg/registry/core/persistentvolumeclaim/storage/storage.go
View file @
2eda19da
...
...
@@ -35,12 +35,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against persistent volume claims.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolumeClaim
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolumeClaimList
{}
},
PredicateFunc
:
persistentvolumeclaim
.
MatchPersistentVolumeClaim
,
QualifiedResource
:
api
.
Resource
(
"persistentvolumeclaims"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"persistentvolumeclaims"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolumeClaim
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PersistentVolumeClaimList
{}
},
PredicateFunc
:
persistentvolumeclaim
.
MatchPersistentVolumeClaim
,
Default
QualifiedResource
:
api
.
Resource
(
"persistentvolumeclaims"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"persistentvolumeclaims"
),
CreateStrategy
:
persistentvolumeclaim
.
Strategy
,
UpdateStrategy
:
persistentvolumeclaim
.
Strategy
,
...
...
pkg/registry/core/pod/storage/storage.go
View file @
2eda19da
...
...
@@ -66,12 +66,12 @@ type REST struct {
func
NewStorage
(
optsGetter
generic
.
RESTOptionsGetter
,
k
client
.
ConnectionInfoGetter
,
proxyTransport
http
.
RoundTripper
,
podDisruptionBudgetClient
policyclient
.
PodDisruptionBudgetsGetter
)
PodStorage
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Pod
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PodList
{}
},
PredicateFunc
:
pod
.
MatchPod
,
QualifiedResource
:
api
.
Resource
(
"pods"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"pods"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Pod
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PodList
{}
},
PredicateFunc
:
pod
.
MatchPod
,
Default
QualifiedResource
:
api
.
Resource
(
"pods"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"pods"
),
CreateStrategy
:
pod
.
Strategy
,
UpdateStrategy
:
pod
.
Strategy
,
...
...
pkg/registry/core/podtemplate/storage/storage.go
View file @
2eda19da
...
...
@@ -32,12 +32,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against pod templates.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PodTemplate
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PodTemplateList
{}
},
PredicateFunc
:
podtemplate
.
MatchPodTemplate
,
QualifiedResource
:
api
.
Resource
(
"podtemplates"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"podtemplates"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PodTemplate
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
PodTemplateList
{}
},
PredicateFunc
:
podtemplate
.
MatchPodTemplate
,
Default
QualifiedResource
:
api
.
Resource
(
"podtemplates"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"podtemplates"
),
CreateStrategy
:
podtemplate
.
Strategy
,
UpdateStrategy
:
podtemplate
.
Strategy
,
...
...
pkg/registry/core/replicationcontroller/storage/storage.go
View file @
2eda19da
...
...
@@ -61,12 +61,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against replication controllers.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ReplicationController
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ReplicationControllerList
{}
},
PredicateFunc
:
replicationcontroller
.
MatchController
,
QualifiedResource
:
api
.
Resource
(
"replicationcontrollers"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"replicationcontrollers"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ReplicationController
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ReplicationControllerList
{}
},
PredicateFunc
:
replicationcontroller
.
MatchController
,
Default
QualifiedResource
:
api
.
Resource
(
"replicationcontrollers"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"replicationcontrollers"
),
CreateStrategy
:
replicationcontroller
.
Strategy
,
UpdateStrategy
:
replicationcontroller
.
Strategy
,
...
...
pkg/registry/core/resourcequota/storage/storage.go
View file @
2eda19da
...
...
@@ -35,12 +35,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against resource quotas.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ResourceQuota
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ResourceQuotaList
{}
},
PredicateFunc
:
resourcequota
.
MatchResourceQuota
,
QualifiedResource
:
api
.
Resource
(
"resourcequotas"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"resourcequotas"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ResourceQuota
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ResourceQuotaList
{}
},
PredicateFunc
:
resourcequota
.
MatchResourceQuota
,
Default
QualifiedResource
:
api
.
Resource
(
"resourcequotas"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"resourcequotas"
),
CreateStrategy
:
resourcequota
.
Strategy
,
UpdateStrategy
:
resourcequota
.
Strategy
,
...
...
pkg/registry/core/secret/storage/storage.go
View file @
2eda19da
...
...
@@ -32,12 +32,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against secrets.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Secret
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
SecretList
{}
},
PredicateFunc
:
secret
.
Matcher
,
QualifiedResource
:
api
.
Resource
(
"secrets"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"secrets"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Secret
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
SecretList
{}
},
PredicateFunc
:
secret
.
Matcher
,
Default
QualifiedResource
:
api
.
Resource
(
"secrets"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"secrets"
),
CreateStrategy
:
secret
.
Strategy
,
UpdateStrategy
:
secret
.
Strategy
,
...
...
pkg/registry/core/service/storage/storage.go
View file @
2eda19da
...
...
@@ -35,12 +35,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against services.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Service
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ServiceList
{}
},
PredicateFunc
:
service
.
MatchServices
,
QualifiedResource
:
api
.
Resource
(
"services"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"services"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
Service
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ServiceList
{}
},
PredicateFunc
:
service
.
MatchServices
,
Default
QualifiedResource
:
api
.
Resource
(
"services"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"services"
),
CreateStrategy
:
service
.
Strategy
,
UpdateStrategy
:
service
.
Strategy
,
...
...
pkg/registry/core/serviceaccount/storage/storage.go
View file @
2eda19da
...
...
@@ -33,12 +33,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against service accounts.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ServiceAccount
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ServiceAccountList
{}
},
PredicateFunc
:
serviceaccount
.
Matcher
,
QualifiedResource
:
api
.
Resource
(
"serviceaccounts"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"serviceaccounts"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ServiceAccount
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
api
.
ServiceAccountList
{}
},
PredicateFunc
:
serviceaccount
.
Matcher
,
Default
QualifiedResource
:
api
.
Resource
(
"serviceaccounts"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"serviceaccounts"
),
CreateStrategy
:
serviceaccount
.
Strategy
,
UpdateStrategy
:
serviceaccount
.
Strategy
,
...
...
pkg/registry/extensions/daemonset/storage/storage.go
View file @
2eda19da
...
...
@@ -37,12 +37,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against DaemonSets.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
DaemonSet
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
DaemonSetList
{}
},
PredicateFunc
:
daemonset
.
MatchDaemonSet
,
QualifiedResource
:
extensions
.
Resource
(
"daemonsets"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"daemonsets"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
DaemonSet
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
DaemonSetList
{}
},
PredicateFunc
:
daemonset
.
MatchDaemonSet
,
Default
QualifiedResource
:
extensions
.
Resource
(
"daemonsets"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"daemonsets"
),
CreateStrategy
:
daemonset
.
Strategy
,
UpdateStrategy
:
daemonset
.
Strategy
,
...
...
pkg/registry/extensions/deployment/storage/storage.go
View file @
2eda19da
...
...
@@ -63,12 +63,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against deployments.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
,
*
RollbackREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
Deployment
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
DeploymentList
{}
},
PredicateFunc
:
deployment
.
MatchDeployment
,
QualifiedResource
:
extensions
.
Resource
(
"deployments"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"deployments"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
Deployment
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
DeploymentList
{}
},
PredicateFunc
:
deployment
.
MatchDeployment
,
Default
QualifiedResource
:
extensions
.
Resource
(
"deployments"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"deployments"
),
CreateStrategy
:
deployment
.
Strategy
,
UpdateStrategy
:
deployment
.
Strategy
,
...
...
pkg/registry/extensions/ingress/storage/storage.go
View file @
2eda19da
...
...
@@ -37,12 +37,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against replication controllers.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
Ingress
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
IngressList
{}
},
PredicateFunc
:
ingress
.
MatchIngress
,
QualifiedResource
:
extensions
.
Resource
(
"ingresses"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"ingresses"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
Ingress
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
IngressList
{}
},
PredicateFunc
:
ingress
.
MatchIngress
,
Default
QualifiedResource
:
extensions
.
Resource
(
"ingresses"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"ingresses"
),
CreateStrategy
:
ingress
.
Strategy
,
UpdateStrategy
:
ingress
.
Strategy
,
...
...
pkg/registry/extensions/networkpolicy/storage/storage.go
View file @
2eda19da
...
...
@@ -34,12 +34,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against network policies.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensionsapi
.
NetworkPolicy
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
extensionsapi
.
NetworkPolicyList
{}
},
PredicateFunc
:
networkpolicy
.
MatchNetworkPolicy
,
QualifiedResource
:
extensionsapi
.
Resource
(
"networkpolicies"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"networkpolicies"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensionsapi
.
NetworkPolicy
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
extensionsapi
.
NetworkPolicyList
{}
},
PredicateFunc
:
networkpolicy
.
MatchNetworkPolicy
,
Default
QualifiedResource
:
extensionsapi
.
Resource
(
"networkpolicies"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"networkpolicies"
),
CreateStrategy
:
networkpolicy
.
Strategy
,
UpdateStrategy
:
networkpolicy
.
Strategy
,
...
...
pkg/registry/extensions/podsecuritypolicy/storage/storage.go
View file @
2eda19da
...
...
@@ -34,12 +34,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against PodSecurityPolicy objects.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
PodSecurityPolicy
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
PodSecurityPolicyList
{}
},
PredicateFunc
:
podsecuritypolicy
.
MatchPodSecurityPolicy
,
QualifiedResource
:
extensions
.
Resource
(
"podsecuritypolicies"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"podsecuritypolicies"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
PodSecurityPolicy
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
PodSecurityPolicyList
{}
},
PredicateFunc
:
podsecuritypolicy
.
MatchPodSecurityPolicy
,
Default
QualifiedResource
:
extensions
.
Resource
(
"podsecuritypolicies"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"podsecuritypolicies"
),
CreateStrategy
:
podsecuritypolicy
.
Strategy
,
UpdateStrategy
:
podsecuritypolicy
.
Strategy
,
...
...
pkg/registry/extensions/replicaset/storage/storage.go
View file @
2eda19da
...
...
@@ -60,12 +60,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against ReplicaSet.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
ReplicaSet
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
ReplicaSetList
{}
},
PredicateFunc
:
replicaset
.
MatchReplicaSet
,
QualifiedResource
:
extensions
.
Resource
(
"replicasets"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"replicasets"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
ReplicaSet
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
extensions
.
ReplicaSetList
{}
},
PredicateFunc
:
replicaset
.
MatchReplicaSet
,
Default
QualifiedResource
:
extensions
.
Resource
(
"replicasets"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"replicasets"
),
CreateStrategy
:
replicaset
.
Strategy
,
UpdateStrategy
:
replicaset
.
Strategy
,
...
...
pkg/registry/networking/networkpolicy/storage/storage.go
View file @
2eda19da
...
...
@@ -35,12 +35,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against NetworkPolicies
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
networkingapi
.
NetworkPolicy
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
networkingapi
.
NetworkPolicyList
{}
},
PredicateFunc
:
networkpolicy
.
Matcher
,
QualifiedResource
:
networkingapi
.
Resource
(
"networkpolicies"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"networkpolicies"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
networkingapi
.
NetworkPolicy
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
networkingapi
.
NetworkPolicyList
{}
},
PredicateFunc
:
networkpolicy
.
Matcher
,
Default
QualifiedResource
:
networkingapi
.
Resource
(
"networkpolicies"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"networkpolicies"
),
CreateStrategy
:
networkpolicy
.
Strategy
,
UpdateStrategy
:
networkpolicy
.
Strategy
,
...
...
pkg/registry/policy/poddisruptionbudget/storage/storage.go
View file @
2eda19da
...
...
@@ -37,12 +37,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against pod disruption budgets.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
(
*
REST
,
*
StatusREST
)
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
policyapi
.
PodDisruptionBudget
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
policyapi
.
PodDisruptionBudgetList
{}
},
PredicateFunc
:
poddisruptionbudget
.
MatchPodDisruptionBudget
,
QualifiedResource
:
policyapi
.
Resource
(
"poddisruptionbudgets"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"poddisruptionbudgets"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
policyapi
.
PodDisruptionBudget
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
policyapi
.
PodDisruptionBudgetList
{}
},
PredicateFunc
:
poddisruptionbudget
.
MatchPodDisruptionBudget
,
Default
QualifiedResource
:
policyapi
.
Resource
(
"poddisruptionbudgets"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"poddisruptionbudgets"
),
CreateStrategy
:
poddisruptionbudget
.
Strategy
,
UpdateStrategy
:
poddisruptionbudget
.
Strategy
,
...
...
pkg/registry/rbac/clusterrole/storage/storage.go
View file @
2eda19da
...
...
@@ -34,12 +34,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against ClusterRole objects.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
ClusterRole
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
ClusterRoleList
{}
},
PredicateFunc
:
clusterrole
.
Matcher
,
QualifiedResource
:
rbac
.
Resource
(
"clusterroles"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"clusterroles"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
ClusterRole
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
ClusterRoleList
{}
},
PredicateFunc
:
clusterrole
.
Matcher
,
Default
QualifiedResource
:
rbac
.
Resource
(
"clusterroles"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"clusterroles"
),
CreateStrategy
:
clusterrole
.
Strategy
,
UpdateStrategy
:
clusterrole
.
Strategy
,
...
...
pkg/registry/rbac/clusterrolebinding/storage/storage.go
View file @
2eda19da
...
...
@@ -34,12 +34,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against ClusterRoleBinding objects.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
ClusterRoleBinding
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
ClusterRoleBindingList
{}
},
PredicateFunc
:
clusterrolebinding
.
Matcher
,
QualifiedResource
:
rbac
.
Resource
(
"clusterrolebindings"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"clusterrolebindings"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
ClusterRoleBinding
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
ClusterRoleBindingList
{}
},
PredicateFunc
:
clusterrolebinding
.
Matcher
,
Default
QualifiedResource
:
rbac
.
Resource
(
"clusterrolebindings"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"clusterrolebindings"
),
CreateStrategy
:
clusterrolebinding
.
Strategy
,
UpdateStrategy
:
clusterrolebinding
.
Strategy
,
...
...
pkg/registry/rbac/role/storage/storage.go
View file @
2eda19da
...
...
@@ -34,12 +34,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against Role objects.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
Role
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
RoleList
{}
},
PredicateFunc
:
role
.
Matcher
,
QualifiedResource
:
rbac
.
Resource
(
"roles"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"roles"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
Role
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
RoleList
{}
},
PredicateFunc
:
role
.
Matcher
,
Default
QualifiedResource
:
rbac
.
Resource
(
"roles"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"roles"
),
CreateStrategy
:
role
.
Strategy
,
UpdateStrategy
:
role
.
Strategy
,
...
...
pkg/registry/rbac/rolebinding/storage/storage.go
View file @
2eda19da
...
...
@@ -34,12 +34,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against RoleBinding objects.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
RoleBinding
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
RoleBindingList
{}
},
PredicateFunc
:
rolebinding
.
Matcher
,
QualifiedResource
:
rbac
.
Resource
(
"rolebindings"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"rolebindings"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
RoleBinding
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
rbac
.
RoleBindingList
{}
},
PredicateFunc
:
rolebinding
.
Matcher
,
Default
QualifiedResource
:
rbac
.
Resource
(
"rolebindings"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"rolebindings"
),
CreateStrategy
:
rolebinding
.
Strategy
,
UpdateStrategy
:
rolebinding
.
Strategy
,
...
...
pkg/registry/scheduling/priorityclass/storage/storage.go
View file @
2eda19da
...
...
@@ -35,12 +35,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against priority classes.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
schedulingapi
.
PriorityClass
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
schedulingapi
.
PriorityClassList
{}
},
PredicateFunc
:
priorityclass
.
Matcher
,
QualifiedResource
:
schedulingapi
.
Resource
(
"priorityclasses"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"priorityclasses"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
schedulingapi
.
PriorityClass
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
schedulingapi
.
PriorityClassList
{}
},
PredicateFunc
:
priorityclass
.
Matcher
,
Default
QualifiedResource
:
schedulingapi
.
Resource
(
"priorityclasses"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"priorityclasses"
),
CreateStrategy
:
priorityclass
.
Strategy
,
UpdateStrategy
:
priorityclass
.
Strategy
,
...
...
pkg/registry/settings/podpreset/storage/storage.go
View file @
2eda19da
...
...
@@ -34,12 +34,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against replication controllers.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
settingsapi
.
PodPreset
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
settingsapi
.
PodPresetList
{}
},
PredicateFunc
:
podpreset
.
Matcher
,
QualifiedResource
:
settingsapi
.
Resource
(
"podpresets"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"podpresets"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
settingsapi
.
PodPreset
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
settingsapi
.
PodPresetList
{}
},
PredicateFunc
:
podpreset
.
Matcher
,
Default
QualifiedResource
:
settingsapi
.
Resource
(
"podpresets"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"podpresets"
),
CreateStrategy
:
podpreset
.
Strategy
,
UpdateStrategy
:
podpreset
.
Strategy
,
...
...
pkg/registry/storage/storageclass/storage/storage.go
View file @
2eda19da
...
...
@@ -34,12 +34,12 @@ type REST struct {
// NewREST returns a RESTStorage object that will work against persistent volumes.
func
NewREST
(
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
store
:=
&
genericregistry
.
Store
{
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
storageapi
.
StorageClass
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
storageapi
.
StorageClassList
{}
},
PredicateFunc
:
storageclass
.
MatchStorageClasses
,
QualifiedResource
:
storageapi
.
Resource
(
"storageclasses"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"storageclass"
),
Copier
:
api
.
Scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
storageapi
.
StorageClass
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
storageapi
.
StorageClassList
{}
},
PredicateFunc
:
storageclass
.
MatchStorageClasses
,
Default
QualifiedResource
:
storageapi
.
Resource
(
"storageclasses"
),
WatchCacheSize
:
cachesize
.
GetWatchCacheSizeByResource
(
"storageclass"
),
CreateStrategy
:
storageclass
.
Strategy
,
UpdateStrategy
:
storageclass
.
Strategy
,
...
...
staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresource/etcd.go
View file @
2eda19da
...
...
@@ -40,8 +40,8 @@ func NewREST(resource schema.GroupResource, listKind schema.GroupVersionKind, co
ret
.
SetGroupVersionKind
(
listKind
)
return
ret
},
PredicateFunc
:
strategy
.
MatchCustomResourceDefinitionStorage
,
QualifiedResource
:
resource
,
PredicateFunc
:
strategy
.
MatchCustomResourceDefinitionStorage
,
Default
QualifiedResource
:
resource
,
CreateStrategy
:
strategy
,
UpdateStrategy
:
strategy
,
...
...
staging/src/k8s.io/apiextensions-apiserver/pkg/registry/customresourcedefinition/etcd.go
View file @
2eda19da
...
...
@@ -41,11 +41,11 @@ func NewREST(scheme *runtime.Scheme, optsGetter generic.RESTOptionsGetter) *REST
strategy
:=
NewStrategy
(
scheme
)
store
:=
&
genericregistry
.
Store
{
Copier
:
scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
apiextensions
.
CustomResourceDefinition
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
apiextensions
.
CustomResourceDefinitionList
{}
},
PredicateFunc
:
MatchCustomResourceDefinition
,
QualifiedResource
:
apiextensions
.
Resource
(
"customresourcedefinitions"
),
Copier
:
scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
apiextensions
.
CustomResourceDefinition
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
apiextensions
.
CustomResourceDefinitionList
{}
},
PredicateFunc
:
MatchCustomResourceDefinition
,
Default
QualifiedResource
:
apiextensions
.
Resource
(
"customresourcedefinitions"
),
CreateStrategy
:
strategy
,
UpdateStrategy
:
strategy
,
...
...
staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store.go
View file @
2eda19da
This diff is collapsed.
Click to expand it.
staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store_test.go
View file @
2eda19da
...
...
@@ -42,6 +42,7 @@ import (
"k8s.io/apimachinery/pkg/watch"
"k8s.io/apiserver/pkg/apis/example"
examplev1
"k8s.io/apiserver/pkg/apis/example/v1"
"k8s.io/apiserver/pkg/endpoints/request"
genericapirequest
"k8s.io/apiserver/pkg/endpoints/request"
"k8s.io/apiserver/pkg/registry/generic"
"k8s.io/apiserver/pkg/registry/rest"
...
...
@@ -381,6 +382,13 @@ func isInitialized(obj metav1.Object) bool {
return
obj
.
GetInitializers
()
==
nil
}
func
isQualifiedResource
(
err
error
,
kind
,
group
string
)
bool
{
if
err
.
(
errors
.
APIStatus
)
.
Status
()
.
Details
.
Kind
!=
kind
||
err
.
(
errors
.
APIStatus
)
.
Status
()
.
Details
.
Group
!=
group
{
return
false
}
return
true
}
func
TestStoreCreateInitialized
(
t
*
testing
.
T
)
{
podA
:=
&
example
.
Pod
{
ObjectMeta
:
metav1
.
ObjectMeta
{
...
...
@@ -1801,13 +1809,13 @@ func newTestGenericStoreRegistry(t *testing.T, scheme *runtime.Scheme, hasCacheE
}
return
destroyFunc
,
&
Store
{
Copier
:
scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
example
.
Pod
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
example
.
PodList
{}
},
QualifiedResource
:
example
.
Resource
(
"pods"
),
CreateStrategy
:
strategy
,
UpdateStrategy
:
strategy
,
DeleteStrategy
:
strategy
,
Copier
:
scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
example
.
Pod
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
example
.
PodList
{}
},
Default
QualifiedResource
:
example
.
Resource
(
"pods"
),
CreateStrategy
:
strategy
,
UpdateStrategy
:
strategy
,
DeleteStrategy
:
strategy
,
KeyRootFunc
:
func
(
ctx
genericapirequest
.
Context
)
string
{
return
podPrefix
},
...
...
@@ -1842,7 +1850,7 @@ func TestFinalizeDelete(t *testing.T) {
obj
:=
&
example
.
Pod
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"foo"
,
UID
:
"random-uid"
},
}
result
,
err
:=
s
.
finalizeDelete
(
obj
,
false
)
result
,
err
:=
s
.
finalizeDelete
(
genericapirequest
.
NewContext
(),
obj
,
false
)
if
err
!=
nil
{
t
.
Fatalf
(
"unexpected err: %s"
,
err
)
}
...
...
@@ -1852,8 +1860,8 @@ func TestFinalizeDelete(t *testing.T) {
Status
:
metav1
.
StatusSuccess
,
Details
:
&
metav1
.
StatusDetails
{
Name
:
"foo"
,
Group
:
s
.
QualifiedResource
.
Group
,
Kind
:
s
.
QualifiedResource
.
Resource
,
Group
:
s
.
Default
QualifiedResource
.
Group
,
Kind
:
s
.
Default
QualifiedResource
.
Resource
,
UID
:
"random-uid"
,
},
}
...
...
@@ -1861,3 +1869,82 @@ func TestFinalizeDelete(t *testing.T) {
t
.
Errorf
(
"unexpected obj. expected %#v, got %#v"
,
expectedObj
,
returnedObj
)
}
}
func
fakeRequestInfo
(
resource
,
apiGroup
string
)
*
request
.
RequestInfo
{
return
&
request
.
RequestInfo
{
IsResourceRequest
:
true
,
Path
:
"/api/v1/test"
,
Verb
:
"test"
,
APIPrefix
:
"api"
,
APIGroup
:
apiGroup
,
APIVersion
:
"v1"
,
Namespace
:
""
,
Resource
:
resource
,
Subresource
:
""
,
Name
:
""
,
Parts
:
[]
string
{
"test"
},
}
}
func
TestQualifiedResource
(
t
*
testing
.
T
)
{
podA
:=
&
example
.
Pod
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"foo"
,
Namespace
:
"test"
},
Spec
:
example
.
PodSpec
{
NodeName
:
"machine"
},
}
qualifiedKind
:=
"pod"
qualifiedGroup
:=
"test"
testContext
:=
genericapirequest
.
WithNamespace
(
genericapirequest
.
NewContext
(),
"test"
)
testContext
=
genericapirequest
.
WithRequestInfo
(
testContext
,
fakeRequestInfo
(
qualifiedKind
,
qualifiedGroup
))
destroyFunc
,
registry
:=
NewTestGenericStoreRegistry
(
t
)
defer
destroyFunc
()
// update a non-exist object
_
,
_
,
err
:=
registry
.
Update
(
testContext
,
podA
.
Name
,
rest
.
DefaultUpdatedObjectInfo
(
podA
,
scheme
))
if
!
errors
.
IsNotFound
(
err
)
{
t
.
Fatalf
(
"Unexpected error: %v"
,
err
)
}
if
!
isQualifiedResource
(
err
,
qualifiedKind
,
qualifiedGroup
)
{
t
.
Fatalf
(
"Unexpected error: %#v"
,
err
)
}
// get a non-exist object
_
,
err
=
registry
.
Get
(
testContext
,
podA
.
Name
,
&
metav1
.
GetOptions
{})
if
!
errors
.
IsNotFound
(
err
)
{
t
.
Fatalf
(
"Unexpected error: %v"
,
err
)
}
if
!
isQualifiedResource
(
err
,
qualifiedKind
,
qualifiedGroup
)
{
t
.
Fatalf
(
"Unexpected error: %#v"
,
err
)
}
// delete a non-exist object
_
,
_
,
err
=
registry
.
Delete
(
testContext
,
podA
.
Name
,
nil
)
if
!
errors
.
IsNotFound
(
err
)
{
t
.
Fatalf
(
"Unexpected error: %v"
,
err
)
}
if
!
isQualifiedResource
(
err
,
qualifiedKind
,
qualifiedGroup
)
{
t
.
Fatalf
(
"Unexpected error: %#v"
,
err
)
}
// create a non-exist object
_
,
err
=
registry
.
Create
(
testContext
,
podA
,
false
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
// create a exist object will fail
_
,
err
=
registry
.
Create
(
testContext
,
podA
,
false
)
if
!
errors
.
IsAlreadyExists
(
err
)
{
t
.
Fatalf
(
"Unexpected error: %v"
,
err
)
}
if
!
isQualifiedResource
(
err
,
qualifiedKind
,
qualifiedGroup
)
{
t
.
Fatalf
(
"Unexpected error: %#v"
,
err
)
}
}
staging/src/k8s.io/kube-aggregator/pkg/registry/apiservice/etcd/etcd.go
View file @
2eda19da
...
...
@@ -35,11 +35,11 @@ type REST struct {
func
NewREST
(
scheme
*
runtime
.
Scheme
,
optsGetter
generic
.
RESTOptionsGetter
)
*
REST
{
strategy
:=
apiservice
.
NewStrategy
(
scheme
)
store
:=
&
genericregistry
.
Store
{
Copier
:
scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
apiregistration
.
APIService
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
apiregistration
.
APIServiceList
{}
},
PredicateFunc
:
apiservice
.
MatchAPIService
,
QualifiedResource
:
apiregistration
.
Resource
(
"apiservices"
),
Copier
:
scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
apiregistration
.
APIService
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
apiregistration
.
APIServiceList
{}
},
PredicateFunc
:
apiservice
.
MatchAPIService
,
Default
QualifiedResource
:
apiregistration
.
Resource
(
"apiservices"
),
CreateStrategy
:
strategy
,
UpdateStrategy
:
strategy
,
...
...
staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/fischer/etcd.go
View file @
2eda19da
...
...
@@ -29,11 +29,11 @@ func NewREST(scheme *runtime.Scheme, optsGetter generic.RESTOptionsGetter) (*reg
strategy
:=
NewStrategy
(
scheme
)
store
:=
&
genericregistry
.
Store
{
Copier
:
scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
wardle
.
Fischer
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
wardle
.
FischerList
{}
},
PredicateFunc
:
MatchFischer
,
QualifiedResource
:
wardle
.
Resource
(
"fischers"
),
Copier
:
scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
wardle
.
Fischer
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
wardle
.
FischerList
{}
},
PredicateFunc
:
MatchFischer
,
Default
QualifiedResource
:
wardle
.
Resource
(
"fischers"
),
CreateStrategy
:
strategy
,
UpdateStrategy
:
strategy
,
...
...
staging/src/k8s.io/sample-apiserver/pkg/registry/wardle/flunder/etcd.go
View file @
2eda19da
...
...
@@ -29,11 +29,11 @@ func NewREST(scheme *runtime.Scheme, optsGetter generic.RESTOptionsGetter) (*reg
strategy
:=
NewStrategy
(
scheme
)
store
:=
&
genericregistry
.
Store
{
Copier
:
scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
wardle
.
Flunder
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
wardle
.
FlunderList
{}
},
PredicateFunc
:
MatchFlunder
,
QualifiedResource
:
wardle
.
Resource
(
"flunders"
),
Copier
:
scheme
,
NewFunc
:
func
()
runtime
.
Object
{
return
&
wardle
.
Flunder
{}
},
NewListFunc
:
func
()
runtime
.
Object
{
return
&
wardle
.
FlunderList
{}
},
PredicateFunc
:
MatchFlunder
,
Default
QualifiedResource
:
wardle
.
Resource
(
"flunders"
),
CreateStrategy
:
strategy
,
UpdateStrategy
:
strategy
,
...
...
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