Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commands: update for logging
Browse files Browse the repository at this point in the history
Signed-off-by: Javier <sjavierlopez@gmail.com>
Javier committed Nov 29, 2023
1 parent 7d59b2c commit 87163d2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pkg/crds/crds.go
Original file line number Diff line number Diff line change
@@ -166,17 +166,21 @@ func ensureClusterIsEmpty(ctx context.Context, k8sClientSet kubernetes.Interface
logging.Info("awaiting")
time.Sleep(10 * time.Second)
for {
deployments, err := k8sClientSet.CoreV1().Pods(clusterNamespace).List(ctx, v1.ListOptions{LabelSelector: "rook_cluster=" + clusterNamespace})
pods, 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 {
if len(pods.Items) == 0 {
break
}

fmt.Println("--------")
fmt.Printf("\nfound items: %d\n", len(pods.Items))
for _, i := range pods.Items {
fmt.Printf("\nitem: %s, status: %+vn\n", i.Name, i.Status)
}
fmt.Println("--------")
}
}

0 comments on commit 87163d2

Please sign in to comment.