diff options
| author | gy95 <guoyao17@huawei.com> | 2022-09-06 17:29:53 +0800 |
|---|---|---|
| committer | gy95 <guoyao17@huawei.com> | 2022-09-09 11:04:18 +0800 |
| commit | c0454770db4b8a82dfa2369923ccec3332057797 (patch) | |
| tree | c364ab228e6caea6cee5d7889ef21b095bda31f2 /tests/e2e | |
| parent | fix e2e failure not report (diff) | |
| download | kubeedge-c0454770db4b8a82dfa2369923ccec3332057797.tar.gz | |
fix statefulset e2e error: need namespace and label
Signed-off-by: gy95 <guoyao17@huawei.com>
Diffstat (limited to 'tests/e2e')
| -rw-r--r-- | tests/e2e/utils/common.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/e2e/utils/common.go b/tests/e2e/utils/common.go index 4c52c2f94..4370785b6 100644 --- a/tests/e2e/utils/common.go +++ b/tests/e2e/utils/common.go @@ -1057,14 +1057,18 @@ func DeleteStatefulSet(c clientset.Interface, ns, name string) error { func NewTestStatefulSet(name, imgURL string, replicas int32) *apps.StatefulSet { return &apps.StatefulSet{ ObjectMeta: metav1.ObjectMeta{ - Name: name, - Labels: map[string]string{"app": name}, + Name: name, + Namespace: Namespace, + Labels: map[string]string{"app": name}, }, Spec: apps.StatefulSetSpec{ Replicas: &replicas, + Selector: &metav1.LabelSelector{ + MatchLabels: map[string]string{"app": name}, + }, Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Labels: nil, + Labels: map[string]string{"app": name}, }, Spec: v1.PodSpec{ Containers: []v1.Container{ |
