Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Commit

Permalink
Renamed spec.NumMember to spec.MinMember.
Browse files Browse the repository at this point in the history
Signed-off-by: Da K. Ma <klaus1982.cn@gmail.com>
  • Loading branch information
k82cn committed Sep 30, 2018
1 parent 25fb8f2 commit 4bc07b9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/crds/scheduling_v1alpha1_podgroup.yaml
Expand Up @@ -19,7 +19,7 @@ spec:
type: object
spec:
properties:
numMember:
minMember:
format: int32
type: integer
type: object
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/scheduling/v1alpha1/types.go
Expand Up @@ -44,10 +44,10 @@ type PodGroup struct {

// PodGroupSpec represents the template of a pod group.
type PodGroupSpec struct {
// NumMember defines the number of members/tasks to run the pod group;
// MinMember defines the minimal number of members/tasks to run the pod group;
// if there's not enough resources to start all tasks, the scheduler
// will not start anyone.
NumMember int32 `json:"numMember,omitempty" protobuf:"bytes,1,opt,name=numMember"`
MinMember int32 `json:"minMember,omitempty" protobuf:"bytes,1,opt,name=minMember"`

// Queue defines the queue to allocate resource for PodGroup; if queue does not exist,
// the PodGroup will not be scheduled.
Expand Down
2 changes: 1 addition & 1 deletion pkg/scheduler/api/job_info.go
Expand Up @@ -156,7 +156,7 @@ func (ji *JobInfo) UnsetPodGroup() {
func (ji *JobInfo) SetPodGroup(pg *arbcorev1.PodGroup) {
ji.Name = pg.Name
ji.Namespace = pg.Namespace
ji.MinAvailable = pg.Spec.NumMember
ji.MinAvailable = pg.Spec.MinMember

if len(pg.Spec.Queue) == 0 {
ji.Queue = QueueID(pg.Namespace)
Expand Down
4 changes: 2 additions & 2 deletions test/util.go
Expand Up @@ -287,7 +287,7 @@ func createJobWithOptions(context *context,
Namespace: jns,
},
Spec: arbv1.PodGroupSpec{
NumMember: min,
MinMember: min,
Queue: jq,
},
}
Expand Down Expand Up @@ -375,7 +375,7 @@ func taskReady(ctx *context, jobName string, taskNum int) wait.ConditionFunc {
}

if taskNum < 0 {
taskNum = int(pg.Spec.NumMember)
taskNum = int(pg.Spec.MinMember)
}

return taskNum <= readyTaskNum, nil
Expand Down

0 comments on commit 4bc07b9

Please sign in to comment.