diff --git a/hack/run-e2e.sh b/hack/run-e2e.sh index a952c90798..b0ade87292 100755 --- a/hack/run-e2e.sh +++ b/hack/run-e2e.sh @@ -20,7 +20,10 @@ sed -i "s|{{CA_BUNDLE}}|$CA_BUNDLE|g" hack/e2e-admission-config.yaml sed -i "s|{{host}}|${HOST}|g" hack/e2e-admission-config.yaml sed -i "s|{{hostPort}}|${HOSTPORT}|g" hack/e2e-admission-config.yaml -kubectl create -f hack/e2e-admission-config.yaml +kubectl apply -f hack/e2e-admission-config.yaml + +# Create default queue for tests +kubectl apply -f installer/chart/volcano/templates/default-queue.yaml # start controller nohup ${VK_BIN}/vk-controllers --kubeconfig ${HOME}/.kube/config --master=${MASTER} --logtostderr --v ${LOG_LEVEL} > controller.log 2>&1 & diff --git a/installer/chart/volcano/templates/default-queue.yaml b/installer/chart/volcano/templates/default-queue.yaml new file mode 100644 index 0000000000..3aa233f5db --- /dev/null +++ b/installer/chart/volcano/templates/default-queue.yaml @@ -0,0 +1,6 @@ +apiVersion: scheduling.incubator.k8s.io/v1alpha1 +kind: Queue +metadata: + name: default +spec: + weight: 1 diff --git a/test/e2e/util.go b/test/e2e/util.go index 61d7123b73..4ac3595efe 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -21,7 +21,6 @@ import ( "fmt" "os" "path/filepath" - "strconv" "strings" "time" @@ -105,7 +104,6 @@ type context struct { } func initTestContext() *context { - enableNamespaceAsQueue, _ := strconv.ParseBool(os.Getenv("ENABLE_NAMESPACES_AS_QUEUE")) cxt := &context{ namespace: "test", queues: []string{"q1", "q2"}, @@ -130,7 +128,9 @@ func initTestContext() *context { Expect(err).NotTo(HaveOccurred(), "k8s cluster is required to have one ready worker node at least.") - cxt.enableNamespaceAsQueue = enableNamespaceAsQueue + //NOTE(tommylikehu):NamespaceAsQueue feature was removed from kube-batch, + //we will eventually remove this logic in test as well. + cxt.enableNamespaceAsQueue = false _, err = cxt.kubeclient.CoreV1().Namespaces().Create(&v1.Namespace{ ObjectMeta: metav1.ObjectMeta{ @@ -252,19 +252,6 @@ func createQueues(cxt *context) { Expect(err).NotTo(HaveOccurred()) } - - if !cxt.enableNamespaceAsQueue { - _, err := cxt.kbclient.SchedulingV1alpha1().Queues().Create(&kbv1.Queue{ - ObjectMeta: metav1.ObjectMeta{ - Name: cxt.namespace, - }, - Spec: kbv1.QueueSpec{ - Weight: 1, - }, - }) - - Expect(err).NotTo(HaveOccurred()) - } } func deleteQueues(cxt *context) { @@ -285,14 +272,6 @@ func deleteQueues(cxt *context) { Expect(err).NotTo(HaveOccurred()) } - - if !cxt.enableNamespaceAsQueue { - err := cxt.kbclient.SchedulingV1alpha1().Queues().Delete(cxt.namespace, &metav1.DeleteOptions{ - PropagationPolicy: &foreground, - }) - - Expect(err).NotTo(HaveOccurred()) - } } type taskSpec struct {