Skip to content

Commit

Permalink
commands: more changes
Browse files Browse the repository at this point in the history
Signed-off-by: Javier <[email protected]>
  • Loading branch information
Javier committed Nov 29, 2023
1 parent 0e5a771 commit 7d59b2c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/crds/crds.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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

0 comments on commit 7d59b2c

Please sign in to comment.