Skip to content

Commit

Permalink
Debugging github ci
Browse files Browse the repository at this point in the history
Signed-off-by: Tudor Marcu <[email protected]>
  • Loading branch information
tmarcu committed Apr 7, 2022
1 parent 2119b35 commit bf1f8b6
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions pkg/test/e2e/e2eutil/zookeepercluster_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ package e2eutil
import (
goctx "context"
"fmt"
"strings"
"time"

"github.com/go-logr/logr"
v1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -93,6 +95,35 @@ func WaitForClusterToBecomeReady(logger logr.Logger, k8client client.Client, z *
}

logger.Info(fmt.Sprintf("waiting for pods to become ready (%d/%d), pods (%v)", cluster.Status.ReadyReplicas, size, cluster.Status.Members.Ready))
// Debug info for ci...
var conditions []string
for _, c := range cluster.Status.Conditions {
conditions = append(conditions, fmt.Sprintf("%s %s %s", string(c.Status), c.Message, c.Reason))
}
logger.Info("zookeeper cluster", "name", cluster.ObjectMeta.ClusterName, "statusConditions", strings.Join(conditions, "\n"))
zk := &v1.StatefulSetList{}
err = k8client.List(goctx.TODO(), zk)
if err != nil {
return false, fmt.Errorf("failed to list statefulsets: %v", err)
}
if len(zk.Items) == 0 {
logger.Info("No statefulsets exist")
}
for _, item := range zk.Items {
logger.Info("statefulset info", "name", item.Name, "status", item.Status.String())
}

podList := corev1.PodList{}
err = k8client.List(goctx.TODO(), &podList)
if err != nil {
return false, err
}
if len(podList.Items) == 0 {
logger.Info("no pods found")
}
for _, item := range podList.Items {
logger.Info("pod", "details", item.String())
}

_, condition := cluster.Status.GetClusterCondition(api.ClusterConditionPodsReady)
if condition != nil && condition.Status == corev1.ConditionTrue && cluster.Status.ReadyReplicas == int32(size) {
Expand Down

0 comments on commit bf1f8b6

Please sign in to comment.