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
acb4c00b
Unverified
Commit
acb4c00b
authored
Sep 12, 2016
by
Clayton Coleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EnableGarbageCollection should be a struct member on RESTOptions
Not a global. Now that we have RESTOptions this was an easy change.
parent
96d971fe
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
31 deletions
+21
-31
options.go
cmd/kube-apiserver/app/options/options.go
+0
-5
config.go
pkg/genericapiserver/config.go
+2
-0
server_run_options.go
pkg/genericapiserver/options/server_run_options.go
+6
-0
master.go
pkg/master/master.go
+1
-0
options.go
pkg/registry/generic/options.go
+2
-1
store.go
pkg/registry/generic/registry/store.go
+6
-6
store_test.go
pkg/registry/generic/registry/store_test.go
+3
-6
garbage_collector_test.go
test/integration/garbagecollector/garbage_collector_test.go
+1
-13
No files found.
cmd/kube-apiserver/app/options/options.go
View file @
acb4c00b
...
@@ -24,7 +24,6 @@ import (
...
@@ -24,7 +24,6 @@ import (
genericoptions
"k8s.io/kubernetes/pkg/genericapiserver/options"
genericoptions
"k8s.io/kubernetes/pkg/genericapiserver/options"
kubeletclient
"k8s.io/kubernetes/pkg/kubelet/client"
kubeletclient
"k8s.io/kubernetes/pkg/kubelet/client"
"k8s.io/kubernetes/pkg/master/ports"
"k8s.io/kubernetes/pkg/master/ports"
"k8s.io/kubernetes/pkg/registry/generic/registry"
"github.com/spf13/pflag"
"github.com/spf13/pflag"
)
)
...
@@ -123,8 +122,4 @@ func (s *APIServer) AddFlags(fs *pflag.FlagSet) {
...
@@ -123,8 +122,4 @@ func (s *APIServer) AddFlags(fs *pflag.FlagSet) {
"If true, server will do its best to fix the update request to pass the validation, "
+
"If true, server will do its best to fix the update request to pass the validation, "
+
"e.g., setting empty UID in update request to its existing value. This flag can be turned off "
+
"e.g., setting empty UID in update request to its existing value. This flag can be turned off "
+
"after we fix all the clients that send malformed updates."
)
"after we fix all the clients that send malformed updates."
)
fs
.
BoolVar
(
&
registry
.
EnableGarbageCollector
,
"enable-garbage-collector"
,
true
,
""
+
"Enables the generic garbage collector. MUST be synced with the corresponding flag "
+
"of the kube-controller-manager."
)
}
}
pkg/genericapiserver/config.go
View file @
acb4c00b
...
@@ -75,6 +75,7 @@ type Config struct {
...
@@ -75,6 +75,7 @@ type Config struct {
EnableIndex
bool
EnableIndex
bool
EnableProfiling
bool
EnableProfiling
bool
EnableWatchCache
bool
EnableWatchCache
bool
EnableGarbageCollection
bool
APIPrefix
string
APIPrefix
string
APIGroupPrefix
string
APIGroupPrefix
string
CorsAllowedOriginList
[]
string
CorsAllowedOriginList
[]
string
...
@@ -169,6 +170,7 @@ func NewConfig(options *options.ServerRunOptions) *Config {
...
@@ -169,6 +170,7 @@ func NewConfig(options *options.ServerRunOptions) *Config {
AuditLogMaxAge
:
options
.
AuditLogMaxAge
,
AuditLogMaxAge
:
options
.
AuditLogMaxAge
,
AuditLogMaxBackups
:
options
.
AuditLogMaxBackups
,
AuditLogMaxBackups
:
options
.
AuditLogMaxBackups
,
AuditLogMaxSize
:
options
.
AuditLogMaxSize
,
AuditLogMaxSize
:
options
.
AuditLogMaxSize
,
EnableGarbageCollection
:
options
.
EnableGarbageCollection
,
EnableIndex
:
true
,
EnableIndex
:
true
,
EnableLogsSupport
:
options
.
EnableLogsSupport
,
EnableLogsSupport
:
options
.
EnableLogsSupport
,
EnableProfiling
:
options
.
EnableProfiling
,
EnableProfiling
:
options
.
EnableProfiling
,
...
...
pkg/genericapiserver/options/server_run_options.go
View file @
acb4c00b
...
@@ -83,6 +83,7 @@ type ServerRunOptions struct {
...
@@ -83,6 +83,7 @@ type ServerRunOptions struct {
AuditLogMaxAge
int
AuditLogMaxAge
int
AuditLogMaxBackups
int
AuditLogMaxBackups
int
AuditLogMaxSize
int
AuditLogMaxSize
int
EnableGarbageCollection
bool
EnableLogsSupport
bool
EnableLogsSupport
bool
EnableProfiling
bool
EnableProfiling
bool
EnableSwaggerUI
bool
EnableSwaggerUI
bool
...
@@ -133,6 +134,7 @@ func NewServerRunOptions() *ServerRunOptions {
...
@@ -133,6 +134,7 @@ func NewServerRunOptions() *ServerRunOptions {
DefaultStorageMediaType
:
"application/json"
,
DefaultStorageMediaType
:
"application/json"
,
DefaultStorageVersions
:
registered
.
AllPreferredGroupVersions
(),
DefaultStorageVersions
:
registered
.
AllPreferredGroupVersions
(),
DeleteCollectionWorkers
:
1
,
DeleteCollectionWorkers
:
1
,
EnableGarbageCollection
:
true
,
EnableLogsSupport
:
true
,
EnableLogsSupport
:
true
,
EnableProfiling
:
true
,
EnableProfiling
:
true
,
EnableWatchCache
:
true
,
EnableWatchCache
:
true
,
...
@@ -306,6 +308,10 @@ func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet) {
...
@@ -306,6 +308,10 @@ func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet) {
fs
.
IntVar
(
&
s
.
AuditLogMaxSize
,
"audit-log-maxsize"
,
s
.
AuditLogMaxSize
,
fs
.
IntVar
(
&
s
.
AuditLogMaxSize
,
"audit-log-maxsize"
,
s
.
AuditLogMaxSize
,
"The maximum size in megabytes of the audit log file before it gets rotated. Defaults to 100MB."
)
"The maximum size in megabytes of the audit log file before it gets rotated. Defaults to 100MB."
)
fs
.
BoolVar
(
&
s
.
EnableGarbageCollection
,
"enable-garbage-collector"
,
s
.
EnableGarbageCollection
,
""
+
"Enables the generic garbage collector. MUST be synced with the corresponding flag "
+
"of the kube-controller-manager."
)
fs
.
BoolVar
(
&
s
.
EnableProfiling
,
"profiling"
,
s
.
EnableProfiling
,
fs
.
BoolVar
(
&
s
.
EnableProfiling
,
"profiling"
,
s
.
EnableProfiling
,
"Enable profiling via web interface host:port/debug/pprof/"
)
"Enable profiling via web interface host:port/debug/pprof/"
)
...
...
pkg/master/master.go
View file @
acb4c00b
...
@@ -781,6 +781,7 @@ func (m *Master) GetRESTOptionsOrDie(c *Config, resource unversioned.GroupResour
...
@@ -781,6 +781,7 @@ func (m *Master) GetRESTOptionsOrDie(c *Config, resource unversioned.GroupResour
StorageConfig
:
storageConfig
,
StorageConfig
:
storageConfig
,
Decorator
:
m
.
StorageDecorator
(),
Decorator
:
m
.
StorageDecorator
(),
DeleteCollectionWorkers
:
m
.
deleteCollectionWorkers
,
DeleteCollectionWorkers
:
m
.
deleteCollectionWorkers
,
EnableGarbageCollection
:
c
.
Config
.
EnableGarbageCollection
,
ResourcePrefix
:
c
.
StorageFactory
.
ResourcePrefix
(
resource
),
ResourcePrefix
:
c
.
StorageFactory
.
ResourcePrefix
(
resource
),
}
}
}
}
...
...
pkg/registry/generic/options.go
View file @
acb4c00b
...
@@ -22,7 +22,8 @@ import "k8s.io/kubernetes/pkg/storage/storagebackend"
...
@@ -22,7 +22,8 @@ import "k8s.io/kubernetes/pkg/storage/storagebackend"
type
RESTOptions
struct
{
type
RESTOptions
struct
{
StorageConfig
*
storagebackend
.
Config
StorageConfig
*
storagebackend
.
Config
Decorator
StorageDecorator
Decorator
StorageDecorator
DeleteCollectionWorkers
int
EnableGarbageCollection
bool
DeleteCollectionWorkers
int
ResourcePrefix
string
ResourcePrefix
string
}
}
pkg/registry/generic/registry/store.go
View file @
acb4c00b
...
@@ -42,10 +42,6 @@ import (
...
@@ -42,10 +42,6 @@ import (
"github.com/golang/glog"
"github.com/golang/glog"
)
)
// EnableGarbageCollector affects the handling of Update and Delete requests. It
// must be synced with the corresponding flag in kube-controller-manager.
var
EnableGarbageCollector
bool
// Store implements generic.Registry.
// Store implements generic.Registry.
// It's intended to be embeddable, so that you can implement any
// It's intended to be embeddable, so that you can implement any
// non-generic functions if needed.
// non-generic functions if needed.
...
@@ -93,6 +89,10 @@ type Store struct {
...
@@ -93,6 +89,10 @@ type Store struct {
// Called to cleanup storage clients.
// Called to cleanup storage clients.
DestroyFunc
func
()
DestroyFunc
func
()
// EnableGarbageCollection affects the handling of Update and Delete requests. It
// must be synced with the corresponding flag in kube-controller-manager.
EnableGarbageCollection
bool
// DeleteCollectionWorkers is the maximum number of workers in a single
// DeleteCollectionWorkers is the maximum number of workers in a single
// DeleteCollection call.
// DeleteCollection call.
DeleteCollectionWorkers
int
DeleteCollectionWorkers
int
...
@@ -272,7 +272,7 @@ func (e *Store) Create(ctx api.Context, obj runtime.Object) (runtime.Object, err
...
@@ -272,7 +272,7 @@ func (e *Store) Create(ctx api.Context, obj runtime.Object) (runtime.Object, err
// it further checks if the object's DeletionGracePeriodSeconds is 0. If so, it
// it further checks if the object's DeletionGracePeriodSeconds is 0. If so, it
// returns true.
// returns true.
func
(
e
*
Store
)
shouldDelete
(
ctx
api
.
Context
,
key
string
,
obj
,
existing
runtime
.
Object
)
bool
{
func
(
e
*
Store
)
shouldDelete
(
ctx
api
.
Context
,
key
string
,
obj
,
existing
runtime
.
Object
)
bool
{
if
!
EnableGarbageCollector
{
if
!
e
.
EnableGarbageCollection
{
return
false
return
false
}
}
newMeta
,
err
:=
api
.
ObjectMetaFor
(
obj
)
newMeta
,
err
:=
api
.
ObjectMetaFor
(
obj
)
...
@@ -694,7 +694,7 @@ func (e *Store) Delete(ctx api.Context, name string, options *api.DeleteOptions)
...
@@ -694,7 +694,7 @@ func (e *Store) Delete(ctx api.Context, name string, options *api.DeleteOptions)
var
ignoreNotFound
bool
var
ignoreNotFound
bool
var
deleteImmediately
bool
=
true
var
deleteImmediately
bool
=
true
var
lastExisting
,
out
runtime
.
Object
var
lastExisting
,
out
runtime
.
Object
if
!
EnableGarbageCollector
{
if
!
e
.
EnableGarbageCollection
{
// TODO: remove the check on graceful, because we support no-op updates now.
// TODO: remove the check on graceful, because we support no-op updates now.
if
graceful
{
if
graceful
{
err
,
ignoreNotFound
,
deleteImmediately
,
out
,
lastExisting
=
e
.
updateForGracefulDeletion
(
ctx
,
name
,
key
,
options
,
preconditions
,
obj
)
err
,
ignoreNotFound
,
deleteImmediately
,
out
,
lastExisting
=
e
.
updateForGracefulDeletion
(
ctx
,
name
,
key
,
options
,
preconditions
,
obj
)
...
...
pkg/registry/generic/registry/store_test.go
View file @
acb4c00b
...
@@ -618,9 +618,7 @@ func TestStoreDelete(t *testing.T) {
...
@@ -618,9 +618,7 @@ func TestStoreDelete(t *testing.T) {
}
}
func
TestGracefulStoreHandleFinalizers
(
t
*
testing
.
T
)
{
func
TestGracefulStoreHandleFinalizers
(
t
*
testing
.
T
)
{
EnableGarbageCollector
=
true
initialGeneration
:=
int64
(
1
)
initialGeneration
:=
int64
(
1
)
defer
func
()
{
EnableGarbageCollector
=
false
}()
podWithFinalizer
:=
&
api
.
Pod
{
podWithFinalizer
:=
&
api
.
Pod
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo"
,
Finalizers
:
[]
string
{
"foo.com/x"
},
Generation
:
initialGeneration
},
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo"
,
Finalizers
:
[]
string
{
"foo.com/x"
},
Generation
:
initialGeneration
},
Spec
:
api
.
PodSpec
{
NodeName
:
"machine"
},
Spec
:
api
.
PodSpec
{
NodeName
:
"machine"
},
...
@@ -628,6 +626,7 @@ func TestGracefulStoreHandleFinalizers(t *testing.T) {
...
@@ -628,6 +626,7 @@ func TestGracefulStoreHandleFinalizers(t *testing.T) {
testContext
:=
api
.
WithNamespace
(
api
.
NewContext
(),
"test"
)
testContext
:=
api
.
WithNamespace
(
api
.
NewContext
(),
"test"
)
destroyFunc
,
registry
:=
NewTestGenericStoreRegistry
(
t
)
destroyFunc
,
registry
:=
NewTestGenericStoreRegistry
(
t
)
registry
.
EnableGarbageCollection
=
true
defaultDeleteStrategy
:=
testRESTStrategy
{
api
.
Scheme
,
api
.
SimpleNameGenerator
,
true
,
false
,
true
}
defaultDeleteStrategy
:=
testRESTStrategy
{
api
.
Scheme
,
api
.
SimpleNameGenerator
,
true
,
false
,
true
}
registry
.
DeleteStrategy
=
testGracefulStrategy
{
defaultDeleteStrategy
}
registry
.
DeleteStrategy
=
testGracefulStrategy
{
defaultDeleteStrategy
}
defer
destroyFunc
()
defer
destroyFunc
()
...
@@ -678,9 +677,7 @@ func TestGracefulStoreHandleFinalizers(t *testing.T) {
...
@@ -678,9 +677,7 @@ func TestGracefulStoreHandleFinalizers(t *testing.T) {
}
}
func
TestNonGracefulStoreHandleFinalizers
(
t
*
testing
.
T
)
{
func
TestNonGracefulStoreHandleFinalizers
(
t
*
testing
.
T
)
{
EnableGarbageCollector
=
true
initialGeneration
:=
int64
(
1
)
initialGeneration
:=
int64
(
1
)
defer
func
()
{
EnableGarbageCollector
=
false
}()
podWithFinalizer
:=
&
api
.
Pod
{
podWithFinalizer
:=
&
api
.
Pod
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo"
,
Finalizers
:
[]
string
{
"foo.com/x"
},
Generation
:
initialGeneration
},
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"foo"
,
Finalizers
:
[]
string
{
"foo.com/x"
},
Generation
:
initialGeneration
},
Spec
:
api
.
PodSpec
{
NodeName
:
"machine"
},
Spec
:
api
.
PodSpec
{
NodeName
:
"machine"
},
...
@@ -688,6 +685,7 @@ func TestNonGracefulStoreHandleFinalizers(t *testing.T) {
...
@@ -688,6 +685,7 @@ func TestNonGracefulStoreHandleFinalizers(t *testing.T) {
testContext
:=
api
.
WithNamespace
(
api
.
NewContext
(),
"test"
)
testContext
:=
api
.
WithNamespace
(
api
.
NewContext
(),
"test"
)
destroyFunc
,
registry
:=
NewTestGenericStoreRegistry
(
t
)
destroyFunc
,
registry
:=
NewTestGenericStoreRegistry
(
t
)
registry
.
EnableGarbageCollection
=
true
defer
destroyFunc
()
defer
destroyFunc
()
// create pod
// create pod
_
,
err
:=
registry
.
Create
(
testContext
,
podWithFinalizer
)
_
,
err
:=
registry
.
Create
(
testContext
,
podWithFinalizer
)
...
@@ -755,9 +753,7 @@ func TestNonGracefulStoreHandleFinalizers(t *testing.T) {
...
@@ -755,9 +753,7 @@ func TestNonGracefulStoreHandleFinalizers(t *testing.T) {
}
}
func
TestStoreDeleteWithOrphanDependents
(
t
*
testing
.
T
)
{
func
TestStoreDeleteWithOrphanDependents
(
t
*
testing
.
T
)
{
EnableGarbageCollector
=
true
initialGeneration
:=
int64
(
1
)
initialGeneration
:=
int64
(
1
)
defer
func
()
{
EnableGarbageCollector
=
false
}()
podWithOrphanFinalizer
:=
func
(
name
string
)
*
api
.
Pod
{
podWithOrphanFinalizer
:=
func
(
name
string
)
*
api
.
Pod
{
return
&
api
.
Pod
{
return
&
api
.
Pod
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
name
,
Finalizers
:
[]
string
{
"foo.com/x"
,
api
.
FinalizerOrphan
,
"bar.com/y"
},
Generation
:
initialGeneration
},
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
name
,
Finalizers
:
[]
string
{
"foo.com/x"
,
api
.
FinalizerOrphan
,
"bar.com/y"
},
Generation
:
initialGeneration
},
...
@@ -984,6 +980,7 @@ func TestStoreDeleteWithOrphanDependents(t *testing.T) {
...
@@ -984,6 +980,7 @@ func TestStoreDeleteWithOrphanDependents(t *testing.T) {
testContext
:=
api
.
WithNamespace
(
api
.
NewContext
(),
"test"
)
testContext
:=
api
.
WithNamespace
(
api
.
NewContext
(),
"test"
)
destroyFunc
,
registry
:=
NewTestGenericStoreRegistry
(
t
)
destroyFunc
,
registry
:=
NewTestGenericStoreRegistry
(
t
)
registry
.
EnableGarbageCollection
=
true
defer
destroyFunc
()
defer
destroyFunc
()
for
_
,
tc
:=
range
testcases
{
for
_
,
tc
:=
range
testcases
{
...
...
test/integration/garbagecollector/garbage_collector_test.go
View file @
acb4c00b
...
@@ -38,7 +38,6 @@ import (
...
@@ -38,7 +38,6 @@ import (
"k8s.io/kubernetes/pkg/client/typed/dynamic"
"k8s.io/kubernetes/pkg/client/typed/dynamic"
"k8s.io/kubernetes/pkg/controller/garbagecollector"
"k8s.io/kubernetes/pkg/controller/garbagecollector"
"k8s.io/kubernetes/pkg/controller/garbagecollector/metaonly"
"k8s.io/kubernetes/pkg/controller/garbagecollector/metaonly"
"k8s.io/kubernetes/pkg/registry/generic/registry"
"k8s.io/kubernetes/pkg/runtime/serializer"
"k8s.io/kubernetes/pkg/runtime/serializer"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util/wait"
"k8s.io/kubernetes/pkg/util/wait"
...
@@ -121,6 +120,7 @@ func newOwnerRC(name, namespace string) *v1.ReplicationController {
...
@@ -121,6 +120,7 @@ func newOwnerRC(name, namespace string) *v1.ReplicationController {
func
setup
(
t
*
testing
.
T
)
(
*
httptest
.
Server
,
*
garbagecollector
.
GarbageCollector
,
clientset
.
Interface
)
{
func
setup
(
t
*
testing
.
T
)
(
*
httptest
.
Server
,
*
garbagecollector
.
GarbageCollector
,
clientset
.
Interface
)
{
masterConfig
:=
framework
.
NewIntegrationTestMasterConfig
()
masterConfig
:=
framework
.
NewIntegrationTestMasterConfig
()
masterConfig
.
EnableCoreControllers
=
false
masterConfig
.
EnableCoreControllers
=
false
masterConfig
.
EnableGarbageCollection
=
true
_
,
s
:=
framework
.
RunAMaster
(
masterConfig
)
_
,
s
:=
framework
.
RunAMaster
(
masterConfig
)
clientSet
,
err
:=
clientset
.
NewForConfig
(
&
restclient
.
Config
{
Host
:
s
.
URL
})
clientSet
,
err
:=
clientset
.
NewForConfig
(
&
restclient
.
Config
{
Host
:
s
.
URL
})
...
@@ -153,9 +153,6 @@ func TestCascadingDeletion(t *testing.T) {
...
@@ -153,9 +153,6 @@ func TestCascadingDeletion(t *testing.T) {
ns
:=
framework
.
CreateTestingNamespace
(
"gc-cascading-deletion"
,
s
,
t
)
ns
:=
framework
.
CreateTestingNamespace
(
"gc-cascading-deletion"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
oldEnableGarbageCollector
:=
registry
.
EnableGarbageCollector
registry
.
EnableGarbageCollector
=
true
defer
func
()
{
registry
.
EnableGarbageCollector
=
oldEnableGarbageCollector
}()
rcClient
:=
clientSet
.
Core
()
.
ReplicationControllers
(
ns
.
Name
)
rcClient
:=
clientSet
.
Core
()
.
ReplicationControllers
(
ns
.
Name
)
podClient
:=
clientSet
.
Core
()
.
Pods
(
ns
.
Name
)
podClient
:=
clientSet
.
Core
()
.
Pods
(
ns
.
Name
)
...
@@ -262,9 +259,6 @@ func TestCreateWithNonExistentOwner(t *testing.T) {
...
@@ -262,9 +259,6 @@ func TestCreateWithNonExistentOwner(t *testing.T) {
ns
:=
framework
.
CreateTestingNamespace
(
"gc-non-existing-owner"
,
s
,
t
)
ns
:=
framework
.
CreateTestingNamespace
(
"gc-non-existing-owner"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
oldEnableGarbageCollector
:=
registry
.
EnableGarbageCollector
registry
.
EnableGarbageCollector
=
true
defer
func
()
{
registry
.
EnableGarbageCollector
=
oldEnableGarbageCollector
}()
podClient
:=
clientSet
.
Core
()
.
Pods
(
ns
.
Name
)
podClient
:=
clientSet
.
Core
()
.
Pods
(
ns
.
Name
)
pod
:=
newPod
(
garbageCollectedPodName
,
ns
.
Name
,
[]
v1
.
OwnerReference
{{
UID
:
"doesn't matter"
,
Name
:
toBeDeletedRCName
}})
pod
:=
newPod
(
garbageCollectedPodName
,
ns
.
Name
,
[]
v1
.
OwnerReference
{{
UID
:
"doesn't matter"
,
Name
:
toBeDeletedRCName
}})
...
@@ -367,9 +361,6 @@ func TestStressingCascadingDeletion(t *testing.T) {
...
@@ -367,9 +361,6 @@ func TestStressingCascadingDeletion(t *testing.T) {
ns
:=
framework
.
CreateTestingNamespace
(
"gc-stressing-cascading-deletion"
,
s
,
t
)
ns
:=
framework
.
CreateTestingNamespace
(
"gc-stressing-cascading-deletion"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
oldEnableGarbageCollector
:=
registry
.
EnableGarbageCollector
registry
.
EnableGarbageCollector
=
true
defer
func
()
{
registry
.
EnableGarbageCollector
=
oldEnableGarbageCollector
}()
stopCh
:=
make
(
chan
struct
{})
stopCh
:=
make
(
chan
struct
{})
go
gc
.
Run
(
5
,
stopCh
)
go
gc
.
Run
(
5
,
stopCh
)
defer
close
(
stopCh
)
defer
close
(
stopCh
)
...
@@ -452,9 +443,6 @@ func TestOrphaning(t *testing.T) {
...
@@ -452,9 +443,6 @@ func TestOrphaning(t *testing.T) {
ns
:=
framework
.
CreateTestingNamespace
(
"gc-orphaning"
,
s
,
t
)
ns
:=
framework
.
CreateTestingNamespace
(
"gc-orphaning"
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
defer
framework
.
DeleteTestingNamespace
(
ns
,
s
,
t
)
oldEnableGarbageCollector
:=
registry
.
EnableGarbageCollector
registry
.
EnableGarbageCollector
=
true
defer
func
()
{
registry
.
EnableGarbageCollector
=
oldEnableGarbageCollector
}()
podClient
:=
clientSet
.
Core
()
.
Pods
(
ns
.
Name
)
podClient
:=
clientSet
.
Core
()
.
Pods
(
ns
.
Name
)
rcClient
:=
clientSet
.
Core
()
.
ReplicationControllers
(
ns
.
Name
)
rcClient
:=
clientSet
.
Core
()
.
ReplicationControllers
(
ns
.
Name
)
// create the RC with the orphan finalizer set
// create the RC with the orphan finalizer set
...
...
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