From 84c9709299c2928d758a028cbab0d513ba739c9d Mon Sep 17 00:00:00 2001 From: derekwaynecarr Date: Tue, 24 Mar 2015 10:44:34 -0400 Subject: [PATCH] Increase controller sync time for namespace cleanup --- cmd/kube-controller-manager/app/controllermanager.go | 2 +- pkg/namespace/namespace_controller.go | 2 +- pkg/registry/namespace/etcd/etcd.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/kube-controller-manager/app/controllermanager.go b/cmd/kube-controller-manager/app/controllermanager.go index 1f76ecb3542..53371a31de4 100644 --- a/cmd/kube-controller-manager/app/controllermanager.go +++ b/cmd/kube-controller-manager/app/controllermanager.go @@ -74,7 +74,7 @@ func NewCMServer() *CMServer { Address: util.IP(net.ParseIP("127.0.0.1")), NodeSyncPeriod: 10 * time.Second, ResourceQuotaSyncPeriod: 10 * time.Second, - NamespaceSyncPeriod: 10 * time.Second, + NamespaceSyncPeriod: 1 * time.Minute, RegisterRetryCount: 10, PodEvictionTimeout: 5 * time.Minute, NodeMilliCPU: 1000, diff --git a/pkg/namespace/namespace_controller.go b/pkg/namespace/namespace_controller.go index e3ae3f99c44..94518f5a99f 100644 --- a/pkg/namespace/namespace_controller.go +++ b/pkg/namespace/namespace_controller.go @@ -159,7 +159,7 @@ func (nm *NamespaceManager) syncNamespace(namespace api.Namespace) (err error) { } // if there is a deletion timestamp, and the status is not terminating, then update status - if namespace.DeletionTimestamp != nil && namespace.Status.Phase != api.NamespaceTerminating { + if !namespace.DeletionTimestamp.IsZero() && namespace.Status.Phase != api.NamespaceTerminating { newNamespace := api.Namespace{} newNamespace.ObjectMeta = namespace.ObjectMeta newNamespace.Status = namespace.Status diff --git a/pkg/registry/namespace/etcd/etcd.go b/pkg/registry/namespace/etcd/etcd.go index 03c618d064e..a04fa96e6b8 100644 --- a/pkg/registry/namespace/etcd/etcd.go +++ b/pkg/registry/namespace/etcd/etcd.go @@ -105,7 +105,7 @@ func (r *REST) Delete(ctx api.Context, name string, options *api.DeleteOptions) } func (r *StatusREST) New() runtime.Object { - return &api.Namespace{} + return r.store.New() } // Update alters the status subset of an object. @@ -114,7 +114,7 @@ func (r *StatusREST) Update(ctx api.Context, obj runtime.Object) (runtime.Object } func (r *FinalizeREST) New() runtime.Object { - return &api.Namespace{} + return r.store.New() } // Update alters the status finalizers subset of an object.