// newHandlerForTest returns the admission controller configured for testing. func newHandlerForTest(c clientset.Interface) (admission.MutationInterface, informers.SharedInformerFactory, error) { … } // newMockClientForTest creates a mock client that returns a client configured for the specified list of namespaces. func newMockClientForTest(namespaces []string) *fake.Clientset { … } // newPod returns a new pod for the specified namespace func newPod(namespace string) api.Pod { … } // hasCreateNamespaceAction returns true if it has the create namespace action func hasCreateNamespaceAction(mockClient *fake.Clientset) bool { … } // TestAdmission verifies a namespace is created on create requests for namespace managed resources func TestAdmission(t *testing.T) { … } // TestAdmissionNamespaceExists verifies that no client call is made when a namespace already exists func TestAdmissionNamespaceExists(t *testing.T) { … } // TestAdmissionDryRun verifies that no client call is made on a dry run request func TestAdmissionDryRun(t *testing.T) { … } // TestIgnoreAdmission validates that a request is ignored if its not a create func TestIgnoreAdmission(t *testing.T) { … } func TestAdmissionWithLatentCache(t *testing.T) { … }