Skip to content

Commit

Permalink
Merge pull request #3020 from lowang-bh/little_enhancement
Browse files Browse the repository at this point in the history
enhancemant: make map with cap
  • Loading branch information
volcano-sh-bot authored Aug 2, 2023
2 parents bb3bd54 + 2ed810b commit 9eaa272
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/controllers/apis/job_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ func (ji *JobInfo) Clone() *JobInfo {
Name: ji.Name,
Job: ji.Job,

Pods: make(map[string]map[string]*v1.Pod),
Pods: make(map[string]map[string]*v1.Pod, len(ji.Pods)),
}

for key, pods := range ji.Pods {
job.Pods[key] = make(map[string]*v1.Pod)
job.Pods[key] = make(map[string]*v1.Pod, len(pods))
for pn, pod := range pods {
job.Pods[key][pn] = pod
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/scheduler/api/job_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ func (ji *JobInfo) Clone() *JobInfo {
PodGroup: ji.PodGroup.Clone(),

TaskStatusIndex: map[TaskStatus]tasksMap{},
TaskMinAvailable: make(map[TaskID]int32),
TaskMinAvailable: make(map[TaskID]int32, len(ji.TaskMinAvailable)),
TaskMinAvailableTotal: ji.TaskMinAvailableTotal,
Tasks: tasksMap{},
Preemptable: ji.Preemptable,
Expand Down

0 comments on commit 9eaa272

Please sign in to comment.