diff --git a/pkg/crds/crds.go b/pkg/crds/crds.go index c429dcb5..5c152f98 100644 --- a/pkg/crds/crds.go +++ b/pkg/crds/crds.go @@ -27,6 +27,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes" + "time" ) var cephResources = []string{ @@ -162,14 +163,21 @@ func updatingFinalizers(ctx context.Context, clientsets k8sutil.ClientsetsInterf func ensureClusterIsEmpty(ctx context.Context, k8sClientSet kubernetes.Interface, clusterNamespace string) { logging.Info("waiting to clean up resources") + logging.Info("awaiting") + time.Sleep(10 * time.Second) for { deployments, err := k8sClientSet.CoreV1().Pods(clusterNamespace).List(ctx, v1.ListOptions{LabelSelector: "rook_cluster=" + clusterNamespace}) if err != nil { logging.Fatal(err) } + fmt.Println("--------") + fmt.Printf("\ndeployments: %+v\n", deployments) + fmt.Println("--------") if len(deployments.Items) == 0 { break } } } + +//kubectl get pods --selector=rook_cluster=rook-ceph