From 237fe8fc0aef17265dfe47738e1721a3f96b7dc2 Mon Sep 17 00:00:00 2001 From: vie-serendipity <60083692+vie-serendipity@users.noreply.github.com> Date: Fri, 28 Jul 2023 10:15:19 +0800 Subject: [PATCH] check whether yurt manager's container is ready in e2e (#1631) * modify * modify * modify * modify * move check to deployYurtManager * modify * modify * modify --- test/e2e/cmd/init/converter.go | 13 +++++++++---- test/e2e/cmd/init/init.go | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/test/e2e/cmd/init/converter.go b/test/e2e/cmd/init/converter.go index 5f61b907afb..9108248b90e 100644 --- a/test/e2e/cmd/init/converter.go +++ b/test/e2e/cmd/init/converter.go @@ -286,13 +286,18 @@ func (c *ClusterConverter) deployYurtManager() error { if podList.Items[0].Status.Phase == corev1.PodRunning { for i := range podList.Items[0].Status.Conditions { if podList.Items[0].Status.Conditions[i].Type == corev1.PodReady && - podList.Items[0].Status.Conditions[i].Status == corev1.ConditionTrue { - return true, nil + podList.Items[0].Status.Conditions[i].Status != corev1.ConditionTrue { + klog.Infof("pod(%s/%s): %#v", podList.Items[0].Namespace, podList.Items[0].Name, podList.Items[0]) + return false, nil + } + if podList.Items[0].Status.Conditions[i].Type == corev1.ContainersReady && + podList.Items[0].Status.Conditions[i].Status != corev1.ConditionTrue { + klog.Info("yurt manager's container is not ready") + return false, nil } } } - klog.Infof("pod(%s/%s): %#v", podList.Items[0].Namespace, podList.Items[0].Name, podList.Items[0]) - return false, nil + return true, nil }) } diff --git a/test/e2e/cmd/init/init.go b/test/e2e/cmd/init/init.go index 13cb1981fd8..8e4f7753835 100644 --- a/test/e2e/cmd/init/init.go +++ b/test/e2e/cmd/init/init.go @@ -374,6 +374,7 @@ func (ki *Initializer) prepareKindConfigFile(kindConfigPath string) error { } func (ki *Initializer) configureAddons() error { + if err := ki.configureCoreDnsAddon(); err != nil { return err }