Skip to content

Commit d9d8b71

Browse files
committed
Merge branch 'feature/support-admission-test' of https://github.com/volcano-sh/volcano into feature/support-admission-test
2 parents da85b44 + a602666 commit d9d8b71

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
BIN_DIR=_output/bin
2-
export IMAGE=volcano
3-
export TAG = 1.0
2+
IMAGE=volcano
3+
TAG = 0.1
4+
5+
.EXPORT_ALL_VARIABLES:
46

57
all: controllers scheduler cli admission
68

pkg/controllers/job/cache/cache.go

+3
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ func (jc *jobCache) Run(stopCh <-chan struct{}) {
231231
}
232232

233233
func (jc jobCache) TaskCompleted(jobKey, taskName string) bool {
234+
jc.Lock()
235+
defer jc.Unlock()
236+
234237
var taskReplicas, completed int32
235238

236239
jobInfo, found := jc.jobs[jobKey]

pkg/scheduler/actions/preempt/preempt.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,9 @@ func preempt(
232232
}
233233
preempted.Add(preemptee.Resreq)
234234
// If reclaimed enough resources, break loop to avoid Sub panic.
235-
if resreq.LessEqual(preemptee.Resreq) {
235+
if resreq.LessEqual(preempted) {
236236
break
237237
}
238-
resreq.Sub(preemptee.Resreq)
239238
}
240239

241240
metrics.RegisterPreemptionAttempts()

pkg/scheduler/actions/reclaim/reclaim.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,9 @@ func (alloc *reclaimAction) Execute(ssn *framework.Session) {
166166
}
167167
reclaimed.Add(reclaimee.Resreq)
168168
// If reclaimed enough resources, break loop to avoid Sub panic.
169-
if resreq.LessEqual(reclaimee.Resreq) {
169+
if resreq.LessEqual(reclaimed) {
170170
break
171171
}
172-
resreq.Sub(reclaimee.Resreq)
173172
}
174173

175174
glog.V(3).Infof("Reclaimed <%v> for task <%s/%s> requested <%v>.",

test/e2e/util.go

-5
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ type jobSpec struct {
295295
tasks []taskSpec
296296
policies []vkv1.LifecyclePolicy
297297
min int32
298-
version int32
299298
}
300299

301300
func getNS(context *context, job *jobSpec) string {
@@ -376,10 +375,6 @@ func createJobInner(context *context, jobSpec *jobSpec) (*vkv1.Job, error) {
376375
min += task.min
377376
}
378377

379-
if jobSpec.version > 0 {
380-
job.Status.Version = jobSpec.version
381-
}
382-
383378
if jobSpec.min > 0 {
384379
job.Spec.MinAvailable = jobSpec.min
385380
} else {

0 commit comments

Comments
 (0)