ceph: remove dead test code for cluster purging

Cluster purging is no longer called, therefore can be removed.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
This commit is contained in:
Travis Nielsen
2020-03-05 15:39:39 -07:00
parent 81727cd18b
commit 4ce9b45ffd
3 changed files with 7 additions and 33 deletions
+5 -31
View File
@@ -414,16 +414,14 @@ func (h *CephInstaller) InstallRook(namespace, storeType string, usePVC bool, st
}
// UninstallRook uninstalls rook from k8s
func (h *CephInstaller) UninstallRook(namespace string, gatherLogs bool) {
h.UninstallRookFromMultipleNS(gatherLogs, SystemNamespace(namespace), namespace)
func (h *CephInstaller) UninstallRook(namespace string) {
h.UninstallRookFromMultipleNS(SystemNamespace(namespace), namespace)
}
// UninstallRookFromMultipleNS uninstalls rook from multiple namespaces in k8s
func (h *CephInstaller) UninstallRookFromMultipleNS(gatherLogs bool, systemNamespace string, namespaces ...string) {
if gatherLogs {
// Gather logs after status checks
h.GatherAllRookLogs(h.T().Name(), append([]string{systemNamespace}, namespaces...)...)
}
func (h *CephInstaller) UninstallRookFromMultipleNS(systemNamespace string, namespaces ...string) {
// Gather logs after status checks
h.GatherAllRookLogs(h.T().Name(), append([]string{systemNamespace}, namespaces...)...)
logger.Infof("Uninstalling Rook")
var err error
@@ -583,30 +581,6 @@ func (h *CephInstaller) removeClusterFinalizers(namespace, name string) {
logger.Infof("removed finalizers from cluster %s", objectMeta.Name)
}
func (h *CephInstaller) purgeClusters() error {
// get all namespaces
namespaces, err := h.k8shelper.Clientset.CoreV1().Namespaces().List(metav1.ListOptions{})
if err != nil {
return fmt.Errorf("failed to get namespaces. %+v", err)
}
// look for the clusters in all namespaces
for _, n := range namespaces.Items {
namespace := n.Name
logger.Infof("looking in namespace %s for clusters to purge", namespace)
clusters, err := h.k8shelper.RookClientset.CephV1().CephClusters(namespace).List(metav1.ListOptions{})
if err != nil {
logger.Warningf("failed to get clusters in namespace %s. %+v", namespace, err)
continue
}
if len(clusters.Items) > 0 {
logger.Warningf("FOUND UNEXPECTED CLUSTER IN NAMESPACE %s. Removing...", namespace)
h.UninstallRook(namespace, false)
}
}
return nil
}
func (h *CephInstaller) checkCephHealthStatus(namespace string) {
clusterResource, err := h.k8shelper.RookClientset.CephV1().CephClusters(namespace).Get(namespace, metav1.GetOptions{})
assert.Nil(h.T(), err)
+1 -1
View File
@@ -176,5 +176,5 @@ func (op *TestCluster) SetInstallData(version string) {}
// TearDownRook is a wrapper for tearDown after Suite
func (op *TestCluster) Teardown() {
op.installer.UninstallRook(op.namespace, true)
op.installer.UninstallRook(op.namespace)
}
+1 -1
View File
@@ -177,7 +177,7 @@ func (o MCTestOperations) Setup() {
// TearDownRook is a wrapper for tearDown after suite
func (o MCTestOperations) Teardown() {
o.installer.UninstallRookFromMultipleNS(true, installer.SystemNamespace(o.namespace1), o.namespace1, o.namespace2)
o.installer.UninstallRookFromMultipleNS(installer.SystemNamespace(o.namespace1), o.namespace1, o.namespace2)
}
func (o MCTestOperations) startCluster(namespace, store string) error {