mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Merge pull request #21469 from wojtek-t/parallel_namespace_deletion
Auto commit by PR queue bot
This commit is contained in:
commit
43792754d8
@ -73,10 +73,11 @@ CONTROLLER_MANAGER_TEST_LOG_LEVEL="${CONTROLLER_MANAGER_TEST_LOG_LEVEL:-$TEST_CL
|
|||||||
SCHEDULER_TEST_LOG_LEVEL="${SCHEDULER_TEST_LOG_LEVEL:-$TEST_CLUSTER_LOG_LEVEL}"
|
SCHEDULER_TEST_LOG_LEVEL="${SCHEDULER_TEST_LOG_LEVEL:-$TEST_CLUSTER_LOG_LEVEL}"
|
||||||
KUBEPROXY_TEST_LOG_LEVEL="${KUBEPROXY_TEST_LOG_LEVEL:-$TEST_CLUSTER_LOG_LEVEL}"
|
KUBEPROXY_TEST_LOG_LEVEL="${KUBEPROXY_TEST_LOG_LEVEL:-$TEST_CLUSTER_LOG_LEVEL}"
|
||||||
|
|
||||||
|
TEST_CLUSTER_DELETE_COLLECTION_WORKERS="${TEST_CLUSTER_DELETE_COLLECTION_WORKERS:---delete-collection-workers=1}"
|
||||||
TEST_CLUSTER_RESYNC_PERIOD="${TEST_CLUSTER_RESYNC_PERIOD:---min-resync-period=3m}"
|
TEST_CLUSTER_RESYNC_PERIOD="${TEST_CLUSTER_RESYNC_PERIOD:---min-resync-period=3m}"
|
||||||
|
|
||||||
KUBELET_TEST_ARGS="--max-pods=110 --serialize-image-pulls=false --outofdisk-transition-frequency=0"
|
KUBELET_TEST_ARGS="--max-pods=110 --serialize-image-pulls=false --outofdisk-transition-frequency=0"
|
||||||
APISERVER_TEST_ARGS="--runtime-config=extensions/v1beta1"
|
APISERVER_TEST_ARGS="--runtime-config=extensions/v1beta1 ${TEST_CLUSTER_DELETE_COLLECTION_WORKERS}"
|
||||||
CONTROLLER_MANAGER_TEST_ARGS="${TEST_CLUSTER_RESYNC_PERIOD}"
|
CONTROLLER_MANAGER_TEST_ARGS="${TEST_CLUSTER_RESYNC_PERIOD}"
|
||||||
SCHEDULER_TEST_ARGS=""
|
SCHEDULER_TEST_ARGS=""
|
||||||
KUBEPROXY_TEST_ARGS=""
|
KUBEPROXY_TEST_ARGS=""
|
||||||
|
@ -52,6 +52,7 @@ type APIServer struct {
|
|||||||
CloudConfigFile string
|
CloudConfigFile string
|
||||||
CloudProvider string
|
CloudProvider string
|
||||||
CorsAllowedOriginList []string
|
CorsAllowedOriginList []string
|
||||||
|
DeleteCollectionWorkers int
|
||||||
DeprecatedStorageVersion string
|
DeprecatedStorageVersion string
|
||||||
EnableLogsSupport bool
|
EnableLogsSupport bool
|
||||||
EnableProfiling bool
|
EnableProfiling bool
|
||||||
@ -97,6 +98,7 @@ func NewAPIServer() *APIServer {
|
|||||||
APIPrefix: "/api",
|
APIPrefix: "/api",
|
||||||
AdmissionControl: "AlwaysAdmit",
|
AdmissionControl: "AlwaysAdmit",
|
||||||
AuthorizationMode: "AlwaysAllow",
|
AuthorizationMode: "AlwaysAllow",
|
||||||
|
DeleteCollectionWorkers: 1,
|
||||||
EnableLogsSupport: true,
|
EnableLogsSupport: true,
|
||||||
EtcdPathPrefix: genericapiserver.DefaultEtcdPathPrefix,
|
EtcdPathPrefix: genericapiserver.DefaultEtcdPathPrefix,
|
||||||
EventTTL: 1 * time.Hour,
|
EventTTL: 1 * time.Hour,
|
||||||
@ -232,6 +234,7 @@ func (s *APIServer) AddFlags(fs *pflag.FlagSet) {
|
|||||||
fs.MarkDeprecated("service-node-ports", "see --service-node-port-range instead.")
|
fs.MarkDeprecated("service-node-ports", "see --service-node-port-range instead.")
|
||||||
fs.StringVar(&s.MasterServiceNamespace, "master-service-namespace", s.MasterServiceNamespace, "The namespace from which the kubernetes master services should be injected into pods")
|
fs.StringVar(&s.MasterServiceNamespace, "master-service-namespace", s.MasterServiceNamespace, "The namespace from which the kubernetes master services should be injected into pods")
|
||||||
fs.IntVar(&s.MasterCount, "apiserver-count", s.MasterCount, "The number of apiservers running in the cluster")
|
fs.IntVar(&s.MasterCount, "apiserver-count", s.MasterCount, "The number of apiservers running in the cluster")
|
||||||
|
fs.IntVar(&s.DeleteCollectionWorkers, "delete-collection-workers", s.DeleteCollectionWorkers, "Number of workers spawned for DeleteCollection call. These are used to speed up namespace cleanup.")
|
||||||
fs.Var(&s.RuntimeConfig, "runtime-config", "A set of key=value pairs that describe runtime configuration that may be passed to apiserver. apis/<groupVersion> key can be used to turn on/off specific api versions. apis/<groupVersion>/<resource> can be used to turn on/off specific resources. api/all and api/legacy are special keys to control all and legacy api versions respectively.")
|
fs.Var(&s.RuntimeConfig, "runtime-config", "A set of key=value pairs that describe runtime configuration that may be passed to apiserver. apis/<groupVersion> key can be used to turn on/off specific api versions. apis/<groupVersion>/<resource> can be used to turn on/off specific resources. api/all and api/legacy are special keys to control all and legacy api versions respectively.")
|
||||||
fs.BoolVar(&s.EnableProfiling, "profiling", true, "Enable profiling via web interface host:port/debug/pprof/")
|
fs.BoolVar(&s.EnableProfiling, "profiling", true, "Enable profiling via web interface host:port/debug/pprof/")
|
||||||
// TODO: enable cache in integration tests.
|
// TODO: enable cache in integration tests.
|
||||||
|
@ -470,6 +470,7 @@ func Run(s *options.APIServer) error {
|
|||||||
Serializer: api.Codecs,
|
Serializer: api.Codecs,
|
||||||
},
|
},
|
||||||
EnableCoreControllers: true,
|
EnableCoreControllers: true,
|
||||||
|
DeleteCollectionWorkers: s.DeleteCollectionWorkers,
|
||||||
EventTTL: s.EventTTL,
|
EventTTL: s.EventTTL,
|
||||||
KubeletClient: kubeletClient,
|
KubeletClient: kubeletClient,
|
||||||
|
|
||||||
|
@ -66,6 +66,7 @@ kube-apiserver
|
|||||||
--cloud-config="": The path to the cloud provider configuration file. Empty string for no configuration file.
|
--cloud-config="": The path to the cloud provider configuration file. Empty string for no configuration file.
|
||||||
--cloud-provider="": The provider for cloud services. Empty string for no provider.
|
--cloud-provider="": The provider for cloud services. Empty string for no provider.
|
||||||
--cors-allowed-origins=[]: List of allowed origins for CORS, comma separated. An allowed origin can be a regular expression to support subdomain matching. If this list is empty CORS will not be enabled.
|
--cors-allowed-origins=[]: List of allowed origins for CORS, comma separated. An allowed origin can be a regular expression to support subdomain matching. If this list is empty CORS will not be enabled.
|
||||||
|
--delete-collection-workers=1: Number of workers spawned for DeleteCollection call. These are used to speed up namespace cleanup.
|
||||||
--etcd-prefix="/registry": The prefix for all resource paths in etcd.
|
--etcd-prefix="/registry": The prefix for all resource paths in etcd.
|
||||||
--etcd-quorum-read[=false]: If true, enable quorum read
|
--etcd-quorum-read[=false]: If true, enable quorum read
|
||||||
--etcd-servers=[]: List of etcd servers to watch (http://ip:port), comma separated. Mutually exclusive with -etcd-config
|
--etcd-servers=[]: List of etcd servers to watch (http://ip:port), comma separated. Mutually exclusive with -etcd-config
|
||||||
@ -111,7 +112,7 @@ kube-apiserver
|
|||||||
--watch-cache-sizes=[]: List of watch cache sizes for every resource (pods, nodes, etc.), comma separated. The individual override format: resource#size, where size is a number. It takes effect when watch-cache is enabled.
|
--watch-cache-sizes=[]: List of watch cache sizes for every resource (pods, nodes, etc.), comma separated. The individual override format: resource#size, where size is a number. It takes effect when watch-cache is enabled.
|
||||||
```
|
```
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 18-Feb-2016
|
###### Auto generated by spf13/cobra on 24-Feb-2016
|
||||||
|
|
||||||
|
|
||||||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
||||||
|
@ -142,6 +142,8 @@
|
|||||||
export KUBELET_TEST_LOG_LEVEL="--v=4"
|
export KUBELET_TEST_LOG_LEVEL="--v=4"
|
||||||
# Increase resync period to simulate production
|
# Increase resync period to simulate production
|
||||||
export TEST_CLUSTER_RESYNC_PERIOD="--min-resync-period=12h"
|
export TEST_CLUSTER_RESYNC_PERIOD="--min-resync-period=12h"
|
||||||
|
# Increase delete collection parallelism
|
||||||
|
export TEST_CLUSTER_DELETE_COLLECTION_WORKERS="--delete-collection-workers=16"
|
||||||
- 'gce-examples':
|
- 'gce-examples':
|
||||||
description: 'Run E2E examples test on GCE.'
|
description: 'Run E2E examples test on GCE.'
|
||||||
timeout: 90
|
timeout: 90
|
||||||
|
@ -70,6 +70,7 @@ current-replicas
|
|||||||
default-container-cpu-limit
|
default-container-cpu-limit
|
||||||
default-container-mem-limit
|
default-container-mem-limit
|
||||||
delay-shutdown
|
delay-shutdown
|
||||||
|
delete-collection-workers
|
||||||
delete-namespace
|
delete-namespace
|
||||||
deleting-pods-burst
|
deleting-pods-burst
|
||||||
deleting-pods-qps
|
deleting-pods-qps
|
||||||
|
@ -71,7 +71,7 @@ func (r *registryGetter) GetSecret(namespace, name string) (*api.Secret, error)
|
|||||||
// uses the specified storage to retrieve service accounts and secrets.
|
// uses the specified storage to retrieve service accounts and secrets.
|
||||||
func NewGetterFromStorageInterface(s storage.Interface) serviceaccount.ServiceAccountTokenGetter {
|
func NewGetterFromStorageInterface(s storage.Interface) serviceaccount.ServiceAccountTokenGetter {
|
||||||
return NewGetterFromRegistries(
|
return NewGetterFromRegistries(
|
||||||
serviceaccountregistry.NewRegistry(serviceaccountetcd.NewREST(generic.RESTOptions{s, generic.UndecoratedStorage})),
|
serviceaccountregistry.NewRegistry(serviceaccountetcd.NewREST(generic.RESTOptions{Storage: s, Decorator: generic.UndecoratedStorage})),
|
||||||
secret.NewRegistry(secretetcd.NewREST(generic.RESTOptions{s, generic.UndecoratedStorage})),
|
secret.NewRegistry(secretetcd.NewREST(generic.RESTOptions{Storage: s, Decorator: generic.UndecoratedStorage})),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,7 @@ type Config struct {
|
|||||||
*genericapiserver.Config
|
*genericapiserver.Config
|
||||||
|
|
||||||
EnableCoreControllers bool
|
EnableCoreControllers bool
|
||||||
|
DeleteCollectionWorkers int
|
||||||
EventTTL time.Duration
|
EventTTL time.Duration
|
||||||
KubeletClient kubeletclient.KubeletClient
|
KubeletClient kubeletclient.KubeletClient
|
||||||
// Used to start and monitor tunneling
|
// Used to start and monitor tunneling
|
||||||
@ -106,6 +107,7 @@ type Master struct {
|
|||||||
v1ResourcesStorage map[string]rest.Storage
|
v1ResourcesStorage map[string]rest.Storage
|
||||||
|
|
||||||
enableCoreControllers bool
|
enableCoreControllers bool
|
||||||
|
deleteCollectionWorkers int
|
||||||
// registries are internal client APIs for accessing the storage layer
|
// registries are internal client APIs for accessing the storage layer
|
||||||
// TODO: define the internal typed interface in a way that clients can
|
// TODO: define the internal typed interface in a way that clients can
|
||||||
// also be replaced
|
// also be replaced
|
||||||
@ -151,6 +153,7 @@ func New(c *Config) (*Master, error) {
|
|||||||
m := &Master{
|
m := &Master{
|
||||||
GenericAPIServer: s,
|
GenericAPIServer: s,
|
||||||
enableCoreControllers: c.EnableCoreControllers,
|
enableCoreControllers: c.EnableCoreControllers,
|
||||||
|
deleteCollectionWorkers: c.DeleteCollectionWorkers,
|
||||||
tunneler: c.Tunneler,
|
tunneler: c.Tunneler,
|
||||||
}
|
}
|
||||||
m.InstallAPIs(c)
|
m.InstallAPIs(c)
|
||||||
@ -329,6 +332,7 @@ func (m *Master) initV1ResourcesStorage(c *Config) {
|
|||||||
return generic.RESTOptions{
|
return generic.RESTOptions{
|
||||||
Storage: dbClient(resource),
|
Storage: dbClient(resource),
|
||||||
Decorator: m.StorageDecorator(),
|
Decorator: m.StorageDecorator(),
|
||||||
|
DeleteCollectionWorkers: m.deleteCollectionWorkers,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -612,7 +616,8 @@ func (m *Master) InstallThirdPartyResource(rsrc *extensions.ThirdPartyResource)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Master) thirdpartyapi(group, kind, version string) *apiserver.APIGroupVersion {
|
func (m *Master) thirdpartyapi(group, kind, version string) *apiserver.APIGroupVersion {
|
||||||
resourceStorage := thirdpartyresourcedataetcd.NewREST(generic.RESTOptions{m.thirdPartyStorage, generic.UndecoratedStorage}, group, kind)
|
resourceStorage := thirdpartyresourcedataetcd.NewREST(
|
||||||
|
generic.RESTOptions{m.thirdPartyStorage, generic.UndecoratedStorage, m.deleteCollectionWorkers}, group, kind)
|
||||||
|
|
||||||
apiRoot := makeThirdPartyPath("")
|
apiRoot := makeThirdPartyPath("")
|
||||||
|
|
||||||
@ -664,6 +669,7 @@ func (m *Master) getExtensionResources(c *Config) map[string]rest.Storage {
|
|||||||
return generic.RESTOptions{
|
return generic.RESTOptions{
|
||||||
Storage: c.StorageDestinations.Get(extensions.GroupName, resource),
|
Storage: c.StorageDestinations.Get(extensions.GroupName, resource),
|
||||||
Decorator: m.StorageDecorator(),
|
Decorator: m.StorageDecorator(),
|
||||||
|
DeleteCollectionWorkers: m.deleteCollectionWorkers,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -671,7 +677,7 @@ func (m *Master) getExtensionResources(c *Config) map[string]rest.Storage {
|
|||||||
if isEnabled("horizontalpodautoscalers") {
|
if isEnabled("horizontalpodautoscalers") {
|
||||||
m.constructHPAResources(c, storage)
|
m.constructHPAResources(c, storage)
|
||||||
controllerStorage := expcontrolleretcd.NewStorage(
|
controllerStorage := expcontrolleretcd.NewStorage(
|
||||||
generic.RESTOptions{c.StorageDestinations.Get("", "replicationControllers"), m.StorageDecorator()})
|
generic.RESTOptions{c.StorageDestinations.Get("", "replicationControllers"), m.StorageDecorator(), m.deleteCollectionWorkers})
|
||||||
storage["replicationcontrollers"] = controllerStorage.ReplicationController
|
storage["replicationcontrollers"] = controllerStorage.ReplicationController
|
||||||
storage["replicationcontrollers/scale"] = controllerStorage.Scale
|
storage["replicationcontrollers/scale"] = controllerStorage.Scale
|
||||||
}
|
}
|
||||||
@ -737,6 +743,7 @@ func (m *Master) constructHPAResources(c *Config, restStorage map[string]rest.St
|
|||||||
return generic.RESTOptions{
|
return generic.RESTOptions{
|
||||||
Storage: c.StorageDestinations.Search([]string{autoscaling.GroupName, extensions.GroupName}, resource),
|
Storage: c.StorageDestinations.Search([]string{autoscaling.GroupName, extensions.GroupName}, resource),
|
||||||
Decorator: m.StorageDecorator(),
|
Decorator: m.StorageDecorator(),
|
||||||
|
DeleteCollectionWorkers: m.deleteCollectionWorkers,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
autoscalerStorage, autoscalerStatusStorage := horizontalpodautoscaleretcd.NewREST(restOptions("horizontalpodautoscalers"))
|
autoscalerStorage, autoscalerStatusStorage := horizontalpodautoscaleretcd.NewREST(restOptions("horizontalpodautoscalers"))
|
||||||
@ -773,6 +780,7 @@ func (m *Master) constructJobResources(c *Config, restStorage map[string]rest.St
|
|||||||
return generic.RESTOptions{
|
return generic.RESTOptions{
|
||||||
Storage: c.StorageDestinations.Search([]string{batch.GroupName, extensions.GroupName}, resource),
|
Storage: c.StorageDestinations.Search([]string{batch.GroupName, extensions.GroupName}, resource),
|
||||||
Decorator: m.StorageDecorator(),
|
Decorator: m.StorageDecorator(),
|
||||||
|
DeleteCollectionWorkers: m.deleteCollectionWorkers,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
jobStorage, jobStatusStorage := jobetcd.NewREST(restOptions("jobs"))
|
jobStorage, jobStatusStorage := jobetcd.NewREST(restOptions("jobs"))
|
||||||
|
@ -68,6 +68,8 @@ func NewREST(opts generic.RESTOptions) *REST {
|
|||||||
|
|
||||||
QualifiedResource: api.Resource("configmaps"),
|
QualifiedResource: api.Resource("configmaps"),
|
||||||
|
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
CreateStrategy: configmap.Strategy,
|
CreateStrategy: configmap.Strategy,
|
||||||
UpdateStrategy: configmap.Strategy,
|
UpdateStrategy: configmap.Strategy,
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
return NewREST(restOptions), server
|
return NewREST(restOptions), server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,6 +66,8 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
|
|||||||
},
|
},
|
||||||
QualifiedResource: api.Resource("replicationcontrollers"),
|
QualifiedResource: api.Resource("replicationcontrollers"),
|
||||||
|
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
// Used to validate controller creation
|
// Used to validate controller creation
|
||||||
CreateStrategy: controller.Strategy,
|
CreateStrategy: controller.Strategy,
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
controllerStorage, statusStorage := NewREST(restOptions)
|
controllerStorage, statusStorage := NewREST(restOptions)
|
||||||
return controllerStorage, statusStorage, server
|
return controllerStorage, statusStorage, server
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
|
|||||||
return daemonset.MatchDaemonSet(label, field)
|
return daemonset.MatchDaemonSet(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: extensions.Resource("daemonsets"),
|
QualifiedResource: extensions.Resource("daemonsets"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
// Used to validate daemon set creation
|
// Used to validate daemon set creation
|
||||||
CreateStrategy: daemonset.Strategy,
|
CreateStrategy: daemonset.Strategy,
|
||||||
|
@ -32,7 +32,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
|
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
daemonSetStorage, statusStorage := NewREST(restOptions)
|
daemonSetStorage, statusStorage := NewREST(restOptions)
|
||||||
return daemonSetStorage, statusStorage, server
|
return daemonSetStorage, statusStorage, server
|
||||||
}
|
}
|
||||||
|
@ -90,6 +90,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST, *RollbackREST) {
|
|||||||
return deployment.MatchDeployment(label, field)
|
return deployment.MatchDeployment(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: extensions.Resource("deployments"),
|
QualifiedResource: extensions.Resource("deployments"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
// Used to validate deployment creation.
|
// Used to validate deployment creation.
|
||||||
CreateStrategy: deployment.Strategy,
|
CreateStrategy: deployment.Strategy,
|
||||||
|
@ -36,7 +36,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*DeploymentStorage, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*DeploymentStorage, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
|
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
deploymentStorage := NewStorage(restOptions)
|
deploymentStorage := NewStorage(restOptions)
|
||||||
return &deploymentStorage, server
|
return &deploymentStorage, server
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@ func NewREST(opts generic.RESTOptions) *REST {
|
|||||||
return endpoint.MatchEndpoints(label, field)
|
return endpoint.MatchEndpoints(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: api.Resource("endpoints"),
|
QualifiedResource: api.Resource("endpoints"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
CreateStrategy: endpoint.Strategy,
|
CreateStrategy: endpoint.Strategy,
|
||||||
UpdateStrategy: endpoint.Strategy,
|
UpdateStrategy: endpoint.Strategy,
|
||||||
|
@ -30,7 +30,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
return NewREST(restOptions), server
|
return NewREST(restOptions), server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,6 +57,7 @@ func NewREST(opts generic.RESTOptions, ttl uint64) *REST {
|
|||||||
return ttl, nil
|
return ttl, nil
|
||||||
},
|
},
|
||||||
QualifiedResource: api.Resource("events"),
|
QualifiedResource: api.Resource("events"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
CreateStrategy: event.Strategy,
|
CreateStrategy: event.Strategy,
|
||||||
UpdateStrategy: event.Strategy,
|
UpdateStrategy: event.Strategy,
|
||||||
|
@ -30,7 +30,7 @@ var testTTL uint64 = 60
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
return NewREST(restOptions, testTTL), server
|
return NewREST(restOptions, testTTL), server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*ScaleREST, *etcdtesting.EtcdTestServer, storage.Interface) {
|
func newStorage(t *testing.T) (*ScaleREST, *etcdtesting.EtcdTestServer, storage.Interface) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
return NewStorage(restOptions).Scale, server, etcdStorage
|
return NewStorage(restOptions).Scale, server, etcdStorage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ package etcd
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"sync"
|
||||||
|
|
||||||
"k8s.io/kubernetes/pkg/api"
|
"k8s.io/kubernetes/pkg/api"
|
||||||
kubeerr "k8s.io/kubernetes/pkg/api/errors"
|
kubeerr "k8s.io/kubernetes/pkg/api/errors"
|
||||||
@ -32,6 +33,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/registry/generic"
|
"k8s.io/kubernetes/pkg/registry/generic"
|
||||||
"k8s.io/kubernetes/pkg/runtime"
|
"k8s.io/kubernetes/pkg/runtime"
|
||||||
"k8s.io/kubernetes/pkg/storage"
|
"k8s.io/kubernetes/pkg/storage"
|
||||||
|
utilruntime "k8s.io/kubernetes/pkg/util/runtime"
|
||||||
"k8s.io/kubernetes/pkg/util/validation/field"
|
"k8s.io/kubernetes/pkg/util/validation/field"
|
||||||
"k8s.io/kubernetes/pkg/watch"
|
"k8s.io/kubernetes/pkg/watch"
|
||||||
|
|
||||||
@ -84,6 +86,10 @@ type Etcd struct {
|
|||||||
// Returns a matcher corresponding to the provided labels and fields.
|
// Returns a matcher corresponding to the provided labels and fields.
|
||||||
PredicateFunc func(label labels.Selector, field fields.Selector) generic.Matcher
|
PredicateFunc func(label labels.Selector, field fields.Selector) generic.Matcher
|
||||||
|
|
||||||
|
// DeleteCollectionWorkers is the maximum number of workers in a single
|
||||||
|
// DeleteCollection call.
|
||||||
|
DeleteCollectionWorkers int
|
||||||
|
|
||||||
// Called on all objects returned from the underlying store, after
|
// Called on all objects returned from the underlying store, after
|
||||||
// the exit hooks are invoked. Decorators are intended for integrations
|
// the exit hooks are invoked. Decorators are intended for integrations
|
||||||
// that are above etcd and should only be used for specific cases where
|
// that are above etcd and should only be used for specific cases where
|
||||||
@ -459,16 +465,63 @@ func (e *Etcd) DeleteCollection(ctx api.Context, options *api.DeleteOptions, lis
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
for _, item := range items {
|
// Spawn a number of goroutines, so that we can issue requests to etcd
|
||||||
accessor, err := meta.Accessor(item)
|
// in parallel to speed up deletion.
|
||||||
|
// TODO: Make this proportional to the number of items to delete, up to
|
||||||
|
// DeleteCollectionWorkers (it doesn't make much sense to spawn 16
|
||||||
|
// workers to delete 10 items).
|
||||||
|
workersNumber := e.DeleteCollectionWorkers
|
||||||
|
if workersNumber < 1 {
|
||||||
|
workersNumber = 1
|
||||||
|
}
|
||||||
|
wg := sync.WaitGroup{}
|
||||||
|
toProcess := make(chan int, 2*workersNumber)
|
||||||
|
errs := make(chan error, workersNumber+1)
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
defer utilruntime.HandleCrash(func(panicReason interface{}) {
|
||||||
|
errs <- fmt.Errorf("DeleteCollection distributor panicked: %v", panicReason)
|
||||||
|
})
|
||||||
|
for i := 0; i < len(items); i++ {
|
||||||
|
toProcess <- i
|
||||||
|
}
|
||||||
|
close(toProcess)
|
||||||
|
}()
|
||||||
|
|
||||||
|
wg.Add(workersNumber)
|
||||||
|
for i := 0; i < workersNumber; i++ {
|
||||||
|
go func() {
|
||||||
|
// panics don't cross goroutine boundaries
|
||||||
|
defer utilruntime.HandleCrash(func(panicReason interface{}) {
|
||||||
|
errs <- fmt.Errorf("DeleteCollection goroutine panicked: %v", panicReason)
|
||||||
|
})
|
||||||
|
defer wg.Done()
|
||||||
|
|
||||||
|
for {
|
||||||
|
index, ok := <-toProcess
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
accessor, err := meta.Accessor(items[index])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
errs <- err
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if _, err := e.Delete(ctx, accessor.GetName(), options); err != nil && !kubeerr.IsNotFound(err) {
|
if _, err := e.Delete(ctx, accessor.GetName(), options); err != nil && !kubeerr.IsNotFound(err) {
|
||||||
|
glog.V(4).Infof("Delete %s in DeleteCollection failed: %v", accessor.GetName(), err)
|
||||||
|
errs <- err
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
wg.Wait()
|
||||||
|
select {
|
||||||
|
case err := <-errs:
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
default:
|
||||||
}
|
|
||||||
return listObj, nil
|
return listObj, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Etcd) finalizeDelete(obj runtime.Object, runHooks bool) (runtime.Object, error) {
|
func (e *Etcd) finalizeDelete(obj runtime.Object, runHooks bool) (runtime.Object, error) {
|
||||||
|
@ -24,4 +24,5 @@ import (
|
|||||||
type RESTOptions struct {
|
type RESTOptions struct {
|
||||||
Storage pkgstorage.Interface
|
Storage pkgstorage.Interface
|
||||||
Decorator StorageDecorator
|
Decorator StorageDecorator
|
||||||
|
DeleteCollectionWorkers int
|
||||||
}
|
}
|
||||||
|
@ -63,6 +63,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
|
|||||||
return horizontalpodautoscaler.MatchAutoscaler(label, field)
|
return horizontalpodautoscaler.MatchAutoscaler(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: extensions.Resource("horizontalpodautoscalers"),
|
QualifiedResource: extensions.Resource("horizontalpodautoscalers"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
// Used to validate autoscaler creation
|
// Used to validate autoscaler creation
|
||||||
CreateStrategy: horizontalpodautoscaler.Strategy,
|
CreateStrategy: horizontalpodautoscaler.Strategy,
|
||||||
|
@ -33,7 +33,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
|
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
horizontalPodAutoscalerStorage, statusStorage := NewREST(restOptions)
|
horizontalPodAutoscalerStorage, statusStorage := NewREST(restOptions)
|
||||||
return horizontalPodAutoscalerStorage, statusStorage, server
|
return horizontalPodAutoscalerStorage, statusStorage, server
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
|
|||||||
return ingress.MatchIngress(label, field)
|
return ingress.MatchIngress(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: extensions.Resource("ingresses"),
|
QualifiedResource: extensions.Resource("ingresses"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
// Used to validate controller creation
|
// Used to validate controller creation
|
||||||
CreateStrategy: ingress.Strategy,
|
CreateStrategy: ingress.Strategy,
|
||||||
|
@ -32,7 +32,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
|
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
ingressStorage, statusStorage := NewREST(restOptions)
|
ingressStorage, statusStorage := NewREST(restOptions)
|
||||||
return ingressStorage, statusStorage, server
|
return ingressStorage, statusStorage, server
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
|
|||||||
return job.MatchJob(label, field)
|
return job.MatchJob(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: extensions.Resource("jobs"),
|
QualifiedResource: extensions.Resource("jobs"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
// Used to validate job creation
|
// Used to validate job creation
|
||||||
CreateStrategy: job.Strategy,
|
CreateStrategy: job.Strategy,
|
||||||
|
@ -34,7 +34,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
|
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
jobStorage, statusStorage := NewREST(restOptions)
|
jobStorage, statusStorage := NewREST(restOptions)
|
||||||
return jobStorage, statusStorage, server
|
return jobStorage, statusStorage, server
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@ func NewREST(opts generic.RESTOptions) *REST {
|
|||||||
return limitrange.MatchLimitRange(label, field)
|
return limitrange.MatchLimitRange(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: api.Resource("limitranges"),
|
QualifiedResource: api.Resource("limitranges"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
CreateStrategy: limitrange.Strategy,
|
CreateStrategy: limitrange.Strategy,
|
||||||
UpdateStrategy: limitrange.Strategy,
|
UpdateStrategy: limitrange.Strategy,
|
||||||
|
@ -31,7 +31,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
return NewREST(restOptions), server
|
return NewREST(restOptions), server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,6 +71,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST, *FinalizeREST) {
|
|||||||
return namespace.MatchNamespace(label, field)
|
return namespace.MatchNamespace(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: api.Resource("namespaces"),
|
QualifiedResource: api.Resource("namespaces"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
CreateStrategy: namespace.Strategy,
|
CreateStrategy: namespace.Strategy,
|
||||||
UpdateStrategy: namespace.Strategy,
|
UpdateStrategy: namespace.Strategy,
|
||||||
|
@ -31,7 +31,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
namespaceStorage, _, _ := NewREST(restOptions)
|
namespaceStorage, _, _ := NewREST(restOptions)
|
||||||
return namespaceStorage, server
|
return namespaceStorage, server
|
||||||
}
|
}
|
||||||
|
@ -81,6 +81,7 @@ func NewStorage(opts generic.RESTOptions, connection client.ConnectionInfoGetter
|
|||||||
},
|
},
|
||||||
PredicateFunc: node.MatchNode,
|
PredicateFunc: node.MatchNode,
|
||||||
QualifiedResource: api.Resource("nodes"),
|
QualifiedResource: api.Resource("nodes"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
CreateStrategy: node.Strategy,
|
CreateStrategy: node.Strategy,
|
||||||
UpdateStrategy: node.Strategy,
|
UpdateStrategy: node.Strategy,
|
||||||
|
@ -39,7 +39,7 @@ func (fakeConnectionInfoGetter) GetConnectionInfo(ctx api.Context, nodeName stri
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
storage := NewStorage(restOptions, fakeConnectionInfoGetter{}, nil)
|
storage := NewStorage(restOptions, fakeConnectionInfoGetter{}, nil)
|
||||||
return storage.Node, server
|
return storage.Node, server
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
|
|||||||
return persistentvolume.MatchPersistentVolumes(label, field)
|
return persistentvolume.MatchPersistentVolumes(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: api.Resource("persistentvolumes"),
|
QualifiedResource: api.Resource("persistentvolumes"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
CreateStrategy: persistentvolume.Strategy,
|
CreateStrategy: persistentvolume.Strategy,
|
||||||
UpdateStrategy: persistentvolume.Strategy,
|
UpdateStrategy: persistentvolume.Strategy,
|
||||||
|
@ -33,7 +33,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
persistentVolumeStorage, statusStorage := NewREST(restOptions)
|
persistentVolumeStorage, statusStorage := NewREST(restOptions)
|
||||||
return persistentVolumeStorage, statusStorage, server
|
return persistentVolumeStorage, statusStorage, server
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
|
|||||||
return persistentvolumeclaim.MatchPersistentVolumeClaim(label, field)
|
return persistentvolumeclaim.MatchPersistentVolumeClaim(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: api.Resource("persistentvolumeclaims"),
|
QualifiedResource: api.Resource("persistentvolumeclaims"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
CreateStrategy: persistentvolumeclaim.Strategy,
|
CreateStrategy: persistentvolumeclaim.Strategy,
|
||||||
UpdateStrategy: persistentvolumeclaim.Strategy,
|
UpdateStrategy: persistentvolumeclaim.Strategy,
|
||||||
|
@ -33,7 +33,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
persistentVolumeClaimStorage, statusStorage := NewREST(restOptions)
|
persistentVolumeClaimStorage, statusStorage := NewREST(restOptions)
|
||||||
return persistentVolumeClaimStorage, statusStorage, server
|
return persistentVolumeClaimStorage, statusStorage, server
|
||||||
}
|
}
|
||||||
|
@ -81,6 +81,7 @@ func NewStorage(opts generic.RESTOptions, k client.ConnectionInfoGetter, proxyTr
|
|||||||
return pod.MatchPod(label, field)
|
return pod.MatchPod(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: api.Resource("pods"),
|
QualifiedResource: api.Resource("pods"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
CreateStrategy: pod.Strategy,
|
CreateStrategy: pod.Strategy,
|
||||||
UpdateStrategy: pod.Strategy,
|
UpdateStrategy: pod.Strategy,
|
||||||
|
@ -37,7 +37,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *BindingREST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *BindingREST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 3}
|
||||||
storage := NewStorage(restOptions, nil, nil)
|
storage := NewStorage(restOptions, nil, nil)
|
||||||
return storage.Pod, storage.Binding, storage.Status, server
|
return storage.Pod, storage.Binding, storage.Status, server
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,7 @@ func NewREST(opts generic.RESTOptions) *REST {
|
|||||||
return podsecuritypolicy.MatchPodSecurityPolicy(label, field)
|
return podsecuritypolicy.MatchPodSecurityPolicy(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: extensions.Resource("podsecuritypolicies"),
|
QualifiedResource: extensions.Resource("podsecuritypolicies"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
CreateStrategy: podsecuritypolicy.Strategy,
|
CreateStrategy: podsecuritypolicy.Strategy,
|
||||||
UpdateStrategy: podsecuritypolicy.Strategy,
|
UpdateStrategy: podsecuritypolicy.Strategy,
|
||||||
|
@ -33,7 +33,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "extensions")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "extensions")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
return NewREST(restOptions), server
|
return NewREST(restOptions), server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ func NewREST(opts generic.RESTOptions) *REST {
|
|||||||
return podtemplate.MatchPodTemplate(label, field)
|
return podtemplate.MatchPodTemplate(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: api.Resource("podtemplates"),
|
QualifiedResource: api.Resource("podtemplates"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
CreateStrategy: podtemplate.Strategy,
|
CreateStrategy: podtemplate.Strategy,
|
||||||
UpdateStrategy: podtemplate.Strategy,
|
UpdateStrategy: podtemplate.Strategy,
|
||||||
|
@ -30,7 +30,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
return NewREST(restOptions), server
|
return NewREST(restOptions), server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,6 +81,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
|
|||||||
return replicaset.MatchReplicaSet(label, field)
|
return replicaset.MatchReplicaSet(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: api.Resource("replicasets"),
|
QualifiedResource: api.Resource("replicasets"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
// Used to validate ReplicaSet creation
|
// Used to validate ReplicaSet creation
|
||||||
CreateStrategy: replicaset.Strategy,
|
CreateStrategy: replicaset.Strategy,
|
||||||
|
@ -32,7 +32,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*ReplicaSetStorage, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*ReplicaSetStorage, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "extensions")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "extensions")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
replicaSetStorage := NewStorage(restOptions)
|
replicaSetStorage := NewStorage(restOptions)
|
||||||
return &replicaSetStorage, server
|
return &replicaSetStorage, server
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
|
|||||||
return resourcequota.MatchResourceQuota(label, field)
|
return resourcequota.MatchResourceQuota(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: api.Resource("resourcequotas"),
|
QualifiedResource: api.Resource("resourcequotas"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
CreateStrategy: resourcequota.Strategy,
|
CreateStrategy: resourcequota.Strategy,
|
||||||
UpdateStrategy: resourcequota.Strategy,
|
UpdateStrategy: resourcequota.Strategy,
|
||||||
|
@ -32,7 +32,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
resourceQuotaStorage, statusStorage := NewREST(restOptions)
|
resourceQuotaStorage, statusStorage := NewREST(restOptions)
|
||||||
return resourceQuotaStorage, statusStorage, server
|
return resourceQuotaStorage, statusStorage, server
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@ func NewREST(opts generic.RESTOptions) *REST {
|
|||||||
return secret.Matcher(label, field)
|
return secret.Matcher(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: api.Resource("secrets"),
|
QualifiedResource: api.Resource("secrets"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
CreateStrategy: secret.Strategy,
|
CreateStrategy: secret.Strategy,
|
||||||
UpdateStrategy: secret.Strategy,
|
UpdateStrategy: secret.Strategy,
|
||||||
|
@ -30,7 +30,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
return NewREST(restOptions), server
|
return NewREST(restOptions), server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
|
|||||||
return service.MatchServices(label, field)
|
return service.MatchServices(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: api.Resource("services"),
|
QualifiedResource: api.Resource("services"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
CreateStrategy: service.Strategy,
|
CreateStrategy: service.Strategy,
|
||||||
UpdateStrategy: service.Strategy,
|
UpdateStrategy: service.Strategy,
|
||||||
|
@ -31,7 +31,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
serviceStorage, statusStorage := NewREST(restOptions)
|
serviceStorage, statusStorage := NewREST(restOptions)
|
||||||
return serviceStorage, statusStorage, server
|
return serviceStorage, statusStorage, server
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@ func NewREST(opts generic.RESTOptions) *REST {
|
|||||||
return serviceaccount.Matcher(label, field)
|
return serviceaccount.Matcher(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: api.Resource("serviceaccounts"),
|
QualifiedResource: api.Resource("serviceaccounts"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
|
|
||||||
CreateStrategy: serviceaccount.Strategy,
|
CreateStrategy: serviceaccount.Strategy,
|
||||||
UpdateStrategy: serviceaccount.Strategy,
|
UpdateStrategy: serviceaccount.Strategy,
|
||||||
|
@ -30,7 +30,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
return NewREST(restOptions), server
|
return NewREST(restOptions), server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ func NewREST(opts generic.RESTOptions) *REST {
|
|||||||
return thirdpartyresource.Matcher(label, field)
|
return thirdpartyresource.Matcher(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: extensions.Resource("thirdpartyresources"),
|
QualifiedResource: extensions.Resource("thirdpartyresources"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
CreateStrategy: thirdpartyresource.Strategy,
|
CreateStrategy: thirdpartyresource.Strategy,
|
||||||
UpdateStrategy: thirdpartyresource.Strategy,
|
UpdateStrategy: thirdpartyresource.Strategy,
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
|
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
return NewREST(restOptions), server
|
return NewREST(restOptions), server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +58,7 @@ func NewREST(opts generic.RESTOptions, group, kind string) *REST {
|
|||||||
return thirdpartyresourcedata.Matcher(label, field)
|
return thirdpartyresourcedata.Matcher(label, field)
|
||||||
},
|
},
|
||||||
QualifiedResource: extensions.Resource("thirdpartyresourcedatas"),
|
QualifiedResource: extensions.Resource("thirdpartyresourcedatas"),
|
||||||
|
DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
|
||||||
CreateStrategy: thirdpartyresourcedata.Strategy,
|
CreateStrategy: thirdpartyresourcedata.Strategy,
|
||||||
UpdateStrategy: thirdpartyresourcedata.Strategy,
|
UpdateStrategy: thirdpartyresourcedata.Strategy,
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ import (
|
|||||||
|
|
||||||
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
|
||||||
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
|
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
|
||||||
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage}
|
restOptions := generic.RESTOptions{etcdStorage, generic.UndecoratedStorage, 1}
|
||||||
return NewREST(restOptions, "foo", "bar"), server
|
return NewREST(restOptions, "foo", "bar"), server
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user