From 8ef6c01cfb47bdc81c8e3f51a2b4e7420181e36c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A5=96=E5=BB=BA?= Date: Wed, 24 Aug 2022 16:10:56 +0800 Subject: [PATCH] fix underlay e2e (#1828) --- test/e2e/underlay/underlay.go | 44 ++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/test/e2e/underlay/underlay.go b/test/e2e/underlay/underlay.go index ff740791b0e..4cf353931a6 100644 --- a/test/e2e/underlay/underlay.go +++ b/test/e2e/underlay/underlay.go @@ -310,7 +310,7 @@ var _ = Describe("[Underlay]", func() { ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: Namespace, - Annotations: map[string]string{util.LogicalSwitchAnnotation: name}, + Annotations: map[string]string{util.LogicalSwitchAnnotation: subnet.Name}, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ @@ -379,9 +379,10 @@ var _ = Describe("[Underlay]", func() { var autoMount bool pod := &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: f.GetName(), - Namespace: Namespace, - Labels: map[string]string{"e2e": "true"}, + Name: f.GetName(), + Namespace: Namespace, + Labels: map[string]string{"e2e": "true"}, + Annotations: map[string]string{util.LogicalSwitchAnnotation: Subnet}, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ @@ -450,9 +451,10 @@ var _ = Describe("[Underlay]", func() { var autoMount bool pod := &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: f.GetName(), - Namespace: Namespace, - Labels: map[string]string{"e2e": "true"}, + Name: f.GetName(), + Namespace: Namespace, + Labels: map[string]string{"e2e": "true"}, + Annotations: map[string]string{util.LogicalSwitchAnnotation: Subnet}, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ @@ -541,9 +543,10 @@ var _ = Describe("[Underlay]", func() { var autoMount bool pod := &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: f.GetName(), - Namespace: Namespace, - Labels: map[string]string{"e2e": "true"}, + Name: f.GetName(), + Namespace: Namespace, + Labels: map[string]string{"e2e": "true"}, + Annotations: map[string]string{util.LogicalSwitchAnnotation: Subnet}, }, Spec: corev1.PodSpec{ NodeName: nodes[0], @@ -634,9 +637,10 @@ var _ = Describe("[Underlay]", func() { for i := range nodes { pods[i] = &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("%s-%d", name, i+1), - Namespace: Namespace, - Labels: map[string]string{"e2e": "true"}, + Name: fmt.Sprintf("%s-%d", name, i+1), + Namespace: Namespace, + Labels: map[string]string{"e2e": "true"}, + Annotations: map[string]string{util.LogicalSwitchAnnotation: Subnet}, }, Spec: corev1.PodSpec{ NodeName: nodes[i], @@ -725,9 +729,10 @@ var _ = Describe("[Underlay]", func() { var autoMount bool upod := &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: f.GetName(), - Namespace: Namespace, - Labels: map[string]string{"e2e": "true"}, + Name: f.GetName(), + Namespace: Namespace, + Labels: map[string]string{"e2e": "true"}, + Annotations: map[string]string{util.LogicalSwitchAnnotation: Subnet}, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{ @@ -813,9 +818,10 @@ var _ = Describe("[Underlay]", func() { var autoMount bool pod := &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ - Name: f.GetName(), - Namespace: Namespace, - Labels: map[string]string{"e2e": "true"}, + Name: f.GetName(), + Namespace: Namespace, + Labels: map[string]string{"e2e": "true"}, + Annotations: map[string]string{util.LogicalSwitchAnnotation: Subnet}, }, Spec: corev1.PodSpec{ Containers: []corev1.Container{