From ee53dfc741602cfb6ae0ef52b6caad691f99237e Mon Sep 17 00:00:00 2001 From: derekwaynecarr Date: Fri, 20 Mar 2015 13:43:00 -0400 Subject: [PATCH] Turn on namespace lifecycle plug-in --- cluster/aws/config-default.sh | 2 +- cluster/azure/config-default.sh | 2 +- cluster/gce/config-default.sh | 2 +- cluster/vagrant/config-default.sh | 2 +- pkg/namespace/namespace_controller_test.go | 5 +++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cluster/aws/config-default.sh b/cluster/aws/config-default.sh index b369a93d8d2..0b9e27b5198 100644 --- a/cluster/aws/config-default.sh +++ b/cluster/aws/config-default.sh @@ -71,4 +71,4 @@ DNS_DOMAIN="kubernetes.local" DNS_REPLICAS=1 # Admission Controllers to invoke prior to persisting objects in cluster -ADMISSION_CONTROL=NamespaceAutoProvision,LimitRanger,ResourceQuota +ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,ResourceQuota diff --git a/cluster/azure/config-default.sh b/cluster/azure/config-default.sh index 7174d5ffebc..569e9f00e51 100644 --- a/cluster/azure/config-default.sh +++ b/cluster/azure/config-default.sh @@ -49,4 +49,4 @@ ELASTICSEARCH_LOGGING_REPLICAS=1 ENABLE_CLUSTER_MONITORING="${KUBE_ENABLE_CLUSTER_MONITORING:-true}" # Admission Controllers to invoke prior to persisting objects in cluster -ADMISSION_CONTROL=NamespaceAutoProvision,LimitRanger,ResourceQuota +ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,ResourceQuota diff --git a/cluster/gce/config-default.sh b/cluster/gce/config-default.sh index 36394449ba4..2478613e85c 100755 --- a/cluster/gce/config-default.sh +++ b/cluster/gce/config-default.sh @@ -108,4 +108,4 @@ DNS_DOMAIN="kubernetes.local" DNS_REPLICAS=1 # Admission Controllers to invoke prior to persisting objects in cluster -ADMISSION_CONTROL=NamespaceAutoProvision,LimitRanger,ResourceQuota +ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,ResourceQuota diff --git a/cluster/vagrant/config-default.sh b/cluster/vagrant/config-default.sh index 4427de1450d..bb5b893c18f 100755 --- a/cluster/vagrant/config-default.sh +++ b/cluster/vagrant/config-default.sh @@ -49,7 +49,7 @@ MASTER_USER=vagrant MASTER_PASSWD=vagrant # Admission Controllers to invoke prior to persisting objects in cluster -ADMISSION_CONTROL=NamespaceAutoProvision,LimitRanger,ResourceQuota +ADMISSION_CONTROL=NamespaceLifecycle,NamespaceAutoProvision,LimitRanger,ResourceQuota # Optional: Install node monitoring. ENABLE_NODE_MONITORING=true diff --git a/pkg/namespace/namespace_controller_test.go b/pkg/namespace/namespace_controller_test.go index 5d885f91b6c..6bd11e48627 100644 --- a/pkg/namespace/namespace_controller_test.go +++ b/pkg/namespace/namespace_controller_test.go @@ -21,6 +21,7 @@ import ( "github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/client" + "github.com/GoogleCloudPlatform/kubernetes/pkg/client/cache" "github.com/GoogleCloudPlatform/kubernetes/pkg/util" ) @@ -61,7 +62,7 @@ func TestFinalize(t *testing.T) { func TestSyncNamespaceThatIsTerminating(t *testing.T) { mockClient := &client.Fake{} - nm := NewNamespaceManager(mockClient) + nm := NamespaceManager{kubeClient: mockClient, store: cache.NewStore(cache.MetaNamespaceKeyFunc)} now := util.Now() testNamespace := api.Namespace{ ObjectMeta: api.ObjectMeta{ @@ -101,7 +102,7 @@ func TestSyncNamespaceThatIsTerminating(t *testing.T) { func TestSyncNamespaceThatIsActive(t *testing.T) { mockClient := &client.Fake{} - nm := NewNamespaceManager(mockClient) + nm := NamespaceManager{kubeClient: mockClient, store: cache.NewStore(cache.MetaNamespaceKeyFunc)} testNamespace := api.Namespace{ ObjectMeta: api.ObjectMeta{ Name: "test",