From 87163d2335c6b43ea3dfb059c4fa25ac1fefcfe2 Mon Sep 17 00:00:00 2001 From: Javier Date: Tue, 21 Nov 2023 12:41:02 -0600 Subject: [PATCH] commands: update for logging Signed-off-by: Javier --- pkg/crds/crds.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkg/crds/crds.go b/pkg/crds/crds.go index 5c152f98..023a08fd 100644 --- a/pkg/crds/crds.go +++ b/pkg/crds/crds.go @@ -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("--------") } }