All REST that set DeleteCollectionWorkers should set EnableGC

pull/6/head
Clayton Coleman 2016-09-12 19:24:03 -04:00
parent acb4c00b39
commit 716bac3bbb
No known key found for this signature in database
GPG Key ID: 3D16906B4F1C5CB3
35 changed files with 37 additions and 1 deletions

View File

@ -73,6 +73,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
}, },
PredicateFunc: cluster.MatchCluster, PredicateFunc: cluster.MatchCluster,
QualifiedResource: federation.Resource("clusters"), QualifiedResource: federation.Resource("clusters"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: cluster.Strategy, CreateStrategy: cluster.Strategy,

View File

@ -66,6 +66,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST, *ApprovalREST) {
return csrregistry.Matcher(label, field) return csrregistry.Matcher(label, field)
}, },
QualifiedResource: certificates.Resource("certificatesigningrequests"), QualifiedResource: certificates.Resource("certificatesigningrequests"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: csrregistry.Strategy, CreateStrategy: csrregistry.Strategy,

View File

@ -61,6 +61,7 @@ func NewREST(opts generic.RESTOptions) *REST {
}, },
PredicateFunc: clusterrole.Matcher, PredicateFunc: clusterrole.Matcher,
QualifiedResource: rbac.Resource("clusterroles"), QualifiedResource: rbac.Resource("clusterroles"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: clusterrole.Strategy, CreateStrategy: clusterrole.Strategy,

View File

@ -61,6 +61,7 @@ func NewREST(opts generic.RESTOptions) *REST {
}, },
PredicateFunc: clusterrolebinding.Matcher, PredicateFunc: clusterrolebinding.Matcher,
QualifiedResource: rbac.Resource("clusterrolebindings"), QualifiedResource: rbac.Resource("clusterrolebindings"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: clusterrolebinding.Strategy, CreateStrategy: clusterrolebinding.Strategy,

View File

@ -75,6 +75,7 @@ func NewREST(opts generic.RESTOptions) *REST {
QualifiedResource: api.Resource("configmaps"), QualifiedResource: api.Resource("configmaps"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: configmap.Strategy, CreateStrategy: configmap.Strategy,

View File

@ -95,6 +95,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
PredicateFunc: controller.MatchController, PredicateFunc: controller.MatchController,
QualifiedResource: api.Resource("replicationcontrollers"), QualifiedResource: api.Resource("replicationcontrollers"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
// Used to validate controller creation // Used to validate controller creation

View File

@ -70,6 +70,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
// Used to match objects based on labels/fields for list and watch // Used to match objects based on labels/fields for list and watch
PredicateFunc: daemonset.MatchDaemonSet, PredicateFunc: daemonset.MatchDaemonSet,
QualifiedResource: extensions.Resource("daemonsets"), QualifiedResource: extensions.Resource("daemonsets"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
// Used to validate daemon set creation // Used to validate daemon set creation

View File

@ -93,6 +93,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST, *RollbackREST) {
// Used to match objects based on labels/fields for list. // Used to match objects based on labels/fields for list.
PredicateFunc: deployment.MatchDeployment, PredicateFunc: deployment.MatchDeployment,
QualifiedResource: extensions.Resource("deployments"), QualifiedResource: extensions.Resource("deployments"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
// Used to validate deployment creation. // Used to validate deployment creation.

View File

@ -59,6 +59,7 @@ func NewREST(opts generic.RESTOptions) *REST {
}, },
PredicateFunc: endpoint.MatchEndpoints, PredicateFunc: endpoint.MatchEndpoints,
QualifiedResource: api.Resource("endpoints"), QualifiedResource: api.Resource("endpoints"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: endpoint.Strategy, CreateStrategy: endpoint.Strategy,

View File

@ -52,7 +52,9 @@ func NewREST(opts generic.RESTOptions, ttl uint64) *REST {
TTLFunc: func(runtime.Object, uint64, bool) (uint64, error) { TTLFunc: func(runtime.Object, uint64, bool) (uint64, error) {
return ttl, nil return ttl, nil
}, },
QualifiedResource: api.Resource("events"), QualifiedResource: api.Resource("events"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: event.Strategy, CreateStrategy: event.Strategy,

View File

@ -68,6 +68,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
// Used to match objects based on labels/fields for list // Used to match objects based on labels/fields for list
PredicateFunc: horizontalpodautoscaler.MatchAutoscaler, PredicateFunc: horizontalpodautoscaler.MatchAutoscaler,
QualifiedResource: autoscaling.Resource("horizontalpodautoscalers"), QualifiedResource: autoscaling.Resource("horizontalpodautoscalers"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
// Used to validate autoscaler creation // Used to validate autoscaler creation

View File

@ -70,6 +70,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
// Used to match objects based on labels/fields for list and watch // Used to match objects based on labels/fields for list and watch
PredicateFunc: ingress.MatchIngress, PredicateFunc: ingress.MatchIngress,
QualifiedResource: extensions.Resource("ingresses"), QualifiedResource: extensions.Resource("ingresses"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
// Used to validate controller creation // Used to validate controller creation

View File

@ -70,6 +70,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
// Used to match objects based on labels/fields for list and watch // Used to match objects based on labels/fields for list and watch
PredicateFunc: job.MatchJob, PredicateFunc: job.MatchJob,
QualifiedResource: batch.Resource("jobs"), QualifiedResource: batch.Resource("jobs"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
// Used to validate job creation // Used to validate job creation

View File

@ -59,6 +59,7 @@ func NewREST(opts generic.RESTOptions) *REST {
}, },
PredicateFunc: limitrange.MatchLimitRange, PredicateFunc: limitrange.MatchLimitRange,
QualifiedResource: api.Resource("limitranges"), QualifiedResource: api.Resource("limitranges"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: limitrange.Strategy, CreateStrategy: limitrange.Strategy,

View File

@ -77,6 +77,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST, *FinalizeREST) {
}, },
PredicateFunc: namespace.MatchNamespace, PredicateFunc: namespace.MatchNamespace,
QualifiedResource: api.Resource("namespaces"), QualifiedResource: api.Resource("namespaces"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: namespace.Strategy, CreateStrategy: namespace.Strategy,

View File

@ -69,6 +69,7 @@ func NewREST(opts generic.RESTOptions) *REST {
// Used to match objects based on labels/fields for list and watch // Used to match objects based on labels/fields for list and watch
PredicateFunc: networkpolicy.MatchNetworkPolicy, PredicateFunc: networkpolicy.MatchNetworkPolicy,
QualifiedResource: extensionsapi.Resource("networkpolicies"), QualifiedResource: extensionsapi.Resource("networkpolicies"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
// Used to validate controller creation // Used to validate controller creation

View File

@ -92,6 +92,7 @@ func NewStorage(opts generic.RESTOptions, connection client.ConnectionInfoGetter
}, },
PredicateFunc: node.MatchNode, PredicateFunc: node.MatchNode,
QualifiedResource: api.Resource("nodes"), QualifiedResource: api.Resource("nodes"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: node.Strategy, CreateStrategy: node.Strategy,

View File

@ -60,6 +60,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
}, },
PredicateFunc: persistentvolume.MatchPersistentVolumes, PredicateFunc: persistentvolume.MatchPersistentVolumes,
QualifiedResource: api.Resource("persistentvolumes"), QualifiedResource: api.Resource("persistentvolumes"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: persistentvolume.Strategy, CreateStrategy: persistentvolume.Strategy,

View File

@ -60,6 +60,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
}, },
PredicateFunc: persistentvolumeclaim.MatchPersistentVolumeClaim, PredicateFunc: persistentvolumeclaim.MatchPersistentVolumeClaim,
QualifiedResource: api.Resource("persistentvolumeclaims"), QualifiedResource: api.Resource("persistentvolumeclaims"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: persistentvolumeclaim.Strategy, CreateStrategy: persistentvolumeclaim.Strategy,

View File

@ -70,6 +70,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
// Used to match objects based on labels/fields for list and watch // Used to match objects based on labels/fields for list and watch
PredicateFunc: petset.MatchPetSet, PredicateFunc: petset.MatchPetSet,
QualifiedResource: appsapi.Resource("petsets"), QualifiedResource: appsapi.Resource("petsets"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
// Used to validate controller creation // Used to validate controller creation

View File

@ -87,6 +87,7 @@ func NewStorage(opts generic.RESTOptions, k client.ConnectionInfoGetter, proxyTr
}, },
PredicateFunc: pod.MatchPod, PredicateFunc: pod.MatchPod,
QualifiedResource: api.Resource("pods"), QualifiedResource: api.Resource("pods"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: pod.Strategy, CreateStrategy: pod.Strategy,

View File

@ -70,6 +70,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
// Used to match objects based on labels/fields for list and watch // Used to match objects based on labels/fields for list and watch
PredicateFunc: poddisruptionbudget.MatchPodDisruptionBudget, PredicateFunc: poddisruptionbudget.MatchPodDisruptionBudget,
QualifiedResource: policyapi.Resource("poddisruptionbudgets"), QualifiedResource: policyapi.Resource("poddisruptionbudgets"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
// Used to validate controller creation // Used to validate controller creation

View File

@ -61,6 +61,7 @@ func NewREST(opts generic.RESTOptions) *REST {
}, },
PredicateFunc: podsecuritypolicy.MatchPodSecurityPolicy, PredicateFunc: podsecuritypolicy.MatchPodSecurityPolicy,
QualifiedResource: extensions.Resource("podsecuritypolicies"), QualifiedResource: extensions.Resource("podsecuritypolicies"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: podsecuritypolicy.Strategy, CreateStrategy: podsecuritypolicy.Strategy,

View File

@ -59,6 +59,7 @@ func NewREST(opts generic.RESTOptions) *REST {
}, },
PredicateFunc: podtemplate.MatchPodTemplate, PredicateFunc: podtemplate.MatchPodTemplate,
QualifiedResource: api.Resource("podtemplates"), QualifiedResource: api.Resource("podtemplates"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: podtemplate.Strategy, CreateStrategy: podtemplate.Strategy,

View File

@ -93,6 +93,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
// Used to match objects based on labels/fields for list and watch // Used to match objects based on labels/fields for list and watch
PredicateFunc: replicaset.MatchReplicaSet, PredicateFunc: replicaset.MatchReplicaSet,
QualifiedResource: api.Resource("replicasets"), QualifiedResource: api.Resource("replicasets"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
// Used to validate ReplicaSet creation // Used to validate ReplicaSet creation

View File

@ -60,6 +60,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
}, },
PredicateFunc: resourcequota.MatchResourceQuota, PredicateFunc: resourcequota.MatchResourceQuota,
QualifiedResource: api.Resource("resourcequotas"), QualifiedResource: api.Resource("resourcequotas"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: resourcequota.Strategy, CreateStrategy: resourcequota.Strategy,

View File

@ -61,6 +61,7 @@ func NewREST(opts generic.RESTOptions) *REST {
}, },
PredicateFunc: role.Matcher, PredicateFunc: role.Matcher,
QualifiedResource: rbac.Resource("roles"), QualifiedResource: rbac.Resource("roles"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: role.Strategy, CreateStrategy: role.Strategy,

View File

@ -61,6 +61,7 @@ func NewREST(opts generic.RESTOptions) *REST {
}, },
PredicateFunc: rolebinding.Matcher, PredicateFunc: rolebinding.Matcher,
QualifiedResource: rbac.Resource("rolebindings"), QualifiedResource: rbac.Resource("rolebindings"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: rolebinding.Strategy, CreateStrategy: rolebinding.Strategy,

View File

@ -70,6 +70,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
// Used to match objects based on labels/fields for list and watch // Used to match objects based on labels/fields for list and watch
PredicateFunc: scheduledjob.MatchScheduledJob, PredicateFunc: scheduledjob.MatchScheduledJob,
QualifiedResource: batch.Resource("scheduledjobs"), QualifiedResource: batch.Resource("scheduledjobs"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
// Used to validate scheduled job creation // Used to validate scheduled job creation

View File

@ -59,6 +59,7 @@ func NewREST(opts generic.RESTOptions) *REST {
}, },
PredicateFunc: secret.Matcher, PredicateFunc: secret.Matcher,
QualifiedResource: api.Resource("secrets"), QualifiedResource: api.Resource("secrets"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: secret.Strategy, CreateStrategy: secret.Strategy,

View File

@ -60,6 +60,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
}, },
PredicateFunc: service.MatchServices, PredicateFunc: service.MatchServices,
QualifiedResource: api.Resource("services"), QualifiedResource: api.Resource("services"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: service.Strategy, CreateStrategy: service.Strategy,

View File

@ -59,6 +59,7 @@ func NewREST(opts generic.RESTOptions) *REST {
}, },
PredicateFunc: serviceaccount.Matcher, PredicateFunc: serviceaccount.Matcher,
QualifiedResource: api.Resource("serviceaccounts"), QualifiedResource: api.Resource("serviceaccounts"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: serviceaccount.Strategy, CreateStrategy: serviceaccount.Strategy,

View File

@ -60,6 +60,7 @@ func NewREST(opts generic.RESTOptions) *REST {
}, },
PredicateFunc: storageclass.MatchStorageClasses, PredicateFunc: storageclass.MatchStorageClasses,
QualifiedResource: storageapi.Resource("storageclasses"), QualifiedResource: storageapi.Resource("storageclasses"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: storageclass.Strategy, CreateStrategy: storageclass.Strategy,

View File

@ -51,6 +51,7 @@ func NewREST(opts generic.RESTOptions) *REST {
}, },
PredicateFunc: thirdpartyresource.Matcher, PredicateFunc: thirdpartyresource.Matcher,
QualifiedResource: extensions.Resource("thirdpartyresources"), QualifiedResource: extensions.Resource("thirdpartyresources"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: thirdpartyresource.Strategy, CreateStrategy: thirdpartyresource.Strategy,
UpdateStrategy: thirdpartyresource.Strategy, UpdateStrategy: thirdpartyresource.Strategy,

View File

@ -54,6 +54,7 @@ func NewREST(opts generic.RESTOptions, group, kind string) *REST {
}, },
PredicateFunc: thirdpartyresourcedata.Matcher, PredicateFunc: thirdpartyresourcedata.Matcher,
QualifiedResource: extensions.Resource("thirdpartyresourcedatas"), QualifiedResource: extensions.Resource("thirdpartyresourcedatas"),
EnableGarbageCollection: opts.EnableGarbageCollection,
DeleteCollectionWorkers: opts.DeleteCollectionWorkers, DeleteCollectionWorkers: opts.DeleteCollectionWorkers,
CreateStrategy: thirdpartyresourcedata.Strategy, CreateStrategy: thirdpartyresourcedata.Strategy,
UpdateStrategy: thirdpartyresourcedata.Strategy, UpdateStrategy: thirdpartyresourcedata.Strategy,