Skip to content

Commit

Permalink
Merge pull request containers#18298 from tklauser/numcpu-call-twice
Browse files Browse the repository at this point in the history
cmd/podman/pods: omit superfluous runtime.NumCPU call
  • Loading branch information
openshift-ci[bot] authored Apr 21, 2023
2 parents 134912a + 70bd096 commit d4d733e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cmd/podman/pods/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"os"
"runtime"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -207,16 +206,13 @@ func create(cmd *cobra.Command, args []string) error {
}

numCPU := sysinfo.NumCPU()
if numCPU == 0 {
numCPU = runtime.NumCPU()
}
if createOptions.Cpus > float64(numCPU) {
createOptions.Cpus = float64(numCPU)
}
copy := infraOptions.CPUSetCPUs
cpuSet := infraOptions.CPUS
if cpuSet == 0 {
cpuSet = float64(sysinfo.NumCPU())
cpuSet = float64(numCPU)
}
ret, err := parsers.ParseUintList(copy)
copy = ""
Expand Down

0 comments on commit d4d733e

Please sign in to comment.