Skip to content

Commit

Permalink
Fix e2e fail.
Browse files Browse the repository at this point in the history
Signed-off-by: xuezhaojun <zxue@redhat.com>
  • Loading branch information
xuezhaojun committed Oct 17, 2024
1 parent cef39a4 commit c52a44d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,21 @@ func checkAddonStatus() {
// deployment on managedcluster is running
anpAgent, err := kubeClient.AppsV1().Deployments(managedClusterInstallNamespace).Get(context.Background(), "cluster-proxy-proxy-agent", metav1.GetOptions{})
if err != nil {
return err
// log pod log of cluster-proxy-addon-manager
podlist, err := kubeClient.CoreV1().Pods(hubInstallNamespace).List(context.Background(), metav1.ListOptions{})
if err != nil {
return err
}
for _, pod := range podlist.Items {
if strings.Contains(pod.Name, "cluster-proxy-addon-manager") {
podLog, err := kubeClient.CoreV1().Pods(hubInstallNamespace).GetLogs(pod.Name, &corev1.PodLogOptions{}).DoRaw(context.Background())
if err != nil {
return err
}
fmt.Println(string(podLog))
}
}
return fmt.Errorf("deployment %s is not running, %v", "cluster-proxy-proxy-agent", err)
}
if anpAgent.Status.AvailableReplicas < 1 {
return fmt.Errorf("available replicas for %s should be more than 1, but get %d", "anp-agent", anpAgent.Status.AvailableReplicas)
Expand Down

0 comments on commit c52a44d

Please sign in to comment.