Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create default queue for e2e test. #22

Merged
merged 2 commits into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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