File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 99 "path/filepath"
1010 "strings"
1111
12+ "k8s.io/apiserver/pkg/storage/names"
1213 e2e "k8s.io/kubernetes/test/e2e/framework"
1314
1415 corev1 "k8s.io/api/core/v1"
@@ -69,12 +70,18 @@ func (c *CLI) WithoutKubeconf() *CLI {
6970// CreateNamespaceUDN creates a new namespace with required user defined network label during creation time only
7071// required for testing networking UDN features on 4.17z+
7172func (c * CLI ) CreateNamespaceUDN () {
73+ // Create new namespace name here, because c.Namespace() will get existing test namespace
74+ // namespace Create func will be failed with below error
75+ // namespaces "e2e-test-xxx" already exists
76+ newNsName := names .SimpleNameGenerator .GenerateName (fmt .Sprintf ("e2e-test-udn-%s-" , c .kubeFramework .BaseName ))
77+ c .SetNamespace (newNsName )
78+
7279 labels := map [string ]string {
73- "k8s.ovn.org/primary-user-defined-network" : "udn-net " ,
80+ "k8s.ovn.org/primary-user-defined-network" : "" ,
7481 }
7582 namespace := & corev1.Namespace {
7683 ObjectMeta : metav1.ObjectMeta {
77- Name : c . Namespace () ,
84+ Name : newNsName ,
7885 Labels : labels ,
7986 },
8087 }
You can’t perform that action at this time.
0 commit comments