From 25da54739980960bf09ceaa83922f3accbbc2623 Mon Sep 17 00:00:00 2001 From: Maru Newby Date: Tue, 4 Apr 2017 08:17:02 -0700 Subject: [PATCH] fed: remove unused e2e framework --- test/e2e_federation/framework/cluster.go | 3 +- test/e2e_federation/util.go | 47 ------------------------ 2 files changed, 1 insertion(+), 49 deletions(-) diff --git a/test/e2e_federation/framework/cluster.go b/test/e2e_federation/framework/cluster.go index f72e10ee6ae..bbfdcf7c12e 100644 --- a/test/e2e_federation/framework/cluster.go +++ b/test/e2e_federation/framework/cluster.go @@ -53,8 +53,7 @@ type ClusterMap map[string]*Cluster type Cluster struct { Name string *kubeclientset.Clientset - NamespaceCreated bool // Did we need to create a new namespace in this cluster? If so, we should delete it. - BackendPod *v1.Pod // The backend pod, if one's been created. + BackendPod *v1.Pod // The backend pod, if one's been created. } // can not be moved to util, as By and Expect must be put in Ginkgo test unit diff --git a/test/e2e_federation/util.go b/test/e2e_federation/util.go index 2faa0b09806..7817431cc9f 100644 --- a/test/e2e_federation/util.go +++ b/test/e2e_federation/util.go @@ -79,53 +79,6 @@ func createClusterObjectOrFail(f *fedframework.Framework, context *fedframework. framework.Logf("Successfully created cluster object: %s (%s, secret: %s)", context.Name, context.Cluster.Cluster.Server, context.Name) } -// Creates the federation namespace in all underlying clusters. -func createNamespaceInClusters(clusters fedframework.ClusterMap, f *fedframework.Framework) { - nsName := f.FederationNamespace.Name - for name, c := range clusters { - // The e2e Framework created the required namespace in federation control plane, but we need to create it in all the others, if it doesn't yet exist. - // TODO(nikhiljindal): remove this once we have the namespace controller working as expected. - if _, err := c.Clientset.Core().Namespaces().Get(nsName, metav1.GetOptions{}); errors.IsNotFound(err) { - ns := &v1.Namespace{ - ObjectMeta: metav1.ObjectMeta{ - Name: nsName, - }, - } - _, err := c.Clientset.Core().Namespaces().Create(ns) - if err == nil { - c.NamespaceCreated = true - } - framework.ExpectNoError(err, "Couldn't create the namespace %s in cluster %q", nsName, name) - framework.Logf("Namespace %s created in cluster %q", nsName, name) - } else if err != nil { - framework.Logf("Couldn't create the namespace %s in cluster %q: %v", nsName, name, err) - } - } -} - -// Unregisters the given clusters from federation control plane. -// Also deletes the federation namespace from each cluster. -func unregisterClusters(clusters fedframework.ClusterMap, f *fedframework.Framework) { - nsName := f.FederationNamespace.Name - for name, c := range clusters { - if c.NamespaceCreated { - if _, err := c.Clientset.Core().Namespaces().Get(nsName, metav1.GetOptions{}); !errors.IsNotFound(err) { - err := c.Clientset.Core().Namespaces().Delete(nsName, &metav1.DeleteOptions{}) - framework.ExpectNoError(err, "Couldn't delete the namespace %s in cluster %q: %v", nsName, name, err) - } - framework.Logf("Namespace %s deleted in cluster %q", nsName, name) - } - } - - // Delete the registered clusters in the federation API server. - clusterList, err := f.FederationClientset.Federation().Clusters().List(metav1.ListOptions{}) - framework.ExpectNoError(err, "Error listing clusters") - for _, cluster := range clusterList.Items { - err := f.FederationClientset.Federation().Clusters().Delete(cluster.Name, &metav1.DeleteOptions{}) - framework.ExpectNoError(err, "Error deleting cluster %q", cluster.Name) - } -} - // waitForServiceOrFail waits until a service is either present or absent in the cluster specified by clientset. // If the condition is not met within timout, it fails the calling test. func waitForServiceOrFail(clientset *kubeclientset.Clientset, namespace string, service *v1.Service, present bool, timeout time.Duration) {