controlplane: split out SystemNamespaces

Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
This commit is contained in:
Dr. Stefan Schimanski
2024-04-27 10:01:47 +02:00
parent 7b73ee018c
commit 3daae717c3
9 changed files with 16 additions and 6 deletions

View File

@@ -30,8 +30,6 @@ import (
// Test_Controller validates the garbage collection logic for the apiserverleasegc controller.
func Test_Controller(t *testing.T) {
systemNamespaces := []string{metav1.NamespaceSystem, metav1.NamespacePublic, v1.NamespaceNodeLease}
tests := []struct {
name string
namespaces []string
@@ -107,7 +105,8 @@ func Test_Controller(t *testing.T) {
namespaceInformer.Informer().GetIndexer().Add(obj)
}
controller := NewController(clientset, namespaceInformer)
systemNamespaces := []string{metav1.NamespaceSystem, metav1.NamespacePublic, v1.NamespaceNodeLease, metav1.NamespaceDefault}
controller := NewController(systemNamespaces, clientset, namespaceInformer)
clientset.PrependReactor("create", "namespaces", func(action k8stesting.Action) (bool, runtime.Object, error) {
create := action.(k8stesting.CreateAction)