Skip to content

Commit 080023e

Browse files
authored
Merge pull request volcano-sh#22 from volcano-sh/bug/fix_default_queue_error
2 parents 3109453 + af34c0a commit 080023e

File tree

3 files changed

+13
-25
lines changed

3 files changed

+13
-25
lines changed

hack/run-e2e.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ sed -i "s|{{CA_BUNDLE}}|$CA_BUNDLE|g" hack/e2e-admission-config.yaml
2020
sed -i "s|{{host}}|${HOST}|g" hack/e2e-admission-config.yaml
2121
sed -i "s|{{hostPort}}|${HOSTPORT}|g" hack/e2e-admission-config.yaml
2222

23-
kubectl create -f hack/e2e-admission-config.yaml
23+
kubectl apply -f hack/e2e-admission-config.yaml
24+
25+
# Create default queue for tests
26+
kubectl apply -f installer/chart/volcano/templates/default-queue.yaml
2427

2528
# start controller
2629
nohup ${VK_BIN}/vk-controllers --kubeconfig ${HOME}/.kube/config --master=${MASTER} --logtostderr --v ${LOG_LEVEL} > controller.log 2>&1 &
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: scheduling.incubator.k8s.io/v1alpha1
2+
kind: Queue
3+
metadata:
4+
name: default
5+
spec:
6+
weight: 1

test/e2e/util.go

+3-24
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"fmt"
2222
"os"
2323
"path/filepath"
24-
"strconv"
2524
"strings"
2625
"time"
2726

@@ -105,7 +104,6 @@ type context struct {
105104
}
106105

107106
func initTestContext() *context {
108-
enableNamespaceAsQueue, _ := strconv.ParseBool(os.Getenv("ENABLE_NAMESPACES_AS_QUEUE"))
109107
cxt := &context{
110108
namespace: "test",
111109
queues: []string{"q1", "q2"},
@@ -130,7 +128,9 @@ func initTestContext() *context {
130128
Expect(err).NotTo(HaveOccurred(),
131129
"k8s cluster is required to have one ready worker node at least.")
132130

133-
cxt.enableNamespaceAsQueue = enableNamespaceAsQueue
131+
//NOTE(tommylikehu):NamespaceAsQueue feature was removed from kube-batch,
132+
//we will eventually remove this logic in test as well.
133+
cxt.enableNamespaceAsQueue = false
134134

135135
_, err = cxt.kubeclient.CoreV1().Namespaces().Create(&v1.Namespace{
136136
ObjectMeta: metav1.ObjectMeta{
@@ -252,19 +252,6 @@ func createQueues(cxt *context) {
252252

253253
Expect(err).NotTo(HaveOccurred())
254254
}
255-
256-
if !cxt.enableNamespaceAsQueue {
257-
_, err := cxt.kbclient.SchedulingV1alpha1().Queues().Create(&kbv1.Queue{
258-
ObjectMeta: metav1.ObjectMeta{
259-
Name: cxt.namespace,
260-
},
261-
Spec: kbv1.QueueSpec{
262-
Weight: 1,
263-
},
264-
})
265-
266-
Expect(err).NotTo(HaveOccurred())
267-
}
268255
}
269256

270257
func deleteQueues(cxt *context) {
@@ -285,14 +272,6 @@ func deleteQueues(cxt *context) {
285272

286273
Expect(err).NotTo(HaveOccurred())
287274
}
288-
289-
if !cxt.enableNamespaceAsQueue {
290-
err := cxt.kbclient.SchedulingV1alpha1().Queues().Delete(cxt.namespace, &metav1.DeleteOptions{
291-
PropagationPolicy: &foreground,
292-
})
293-
294-
Expect(err).NotTo(HaveOccurred())
295-
}
296275
}
297276

298277
type taskSpec struct {

0 commit comments

Comments
 (0)