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 committed 2020-03-05 15:39:39 -07:00
1 parent 81727cd18b
commit 4ce9b45ffd
3 files changed
+7 -33

No files matched your search

+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)