Skip to content

Commit

Permalink
Merge pull request #22 from volcano-sh/bug/fix_default_queue_error
Browse files Browse the repository at this point in the history
Create default queue for e2e test.
  • Loading branch information
TommyLike authored Mar 18, 2019
2 parents f40483f + 49eca26 commit b6a005e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 25 deletions.
5 changes: 4 additions & 1 deletion hack/run-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &
Expand Down
6 changes: 6 additions & 0 deletions installer/chart/volcano/templates/default-queue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: scheduling.incubator.k8s.io/v1alpha1
kind: Queue
metadata:
name: default
spec:
weight: 1
27 changes: 3 additions & 24 deletions test/e2e/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -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"},
Expand All @@ -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{
Expand Down Expand Up @@ -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) {
Expand All @@ -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 {
Expand Down

0 comments on commit b6a005e

Please sign in to comment.