summaryrefslogtreecommitdiff
path: root/cmd/podman/pods/create.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/pods/create.go')
-rw-r--r--cmd/podman/pods/create.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go
index b45ed0d39..891ff2e3c 100644
--- a/cmd/podman/pods/create.go
+++ b/cmd/podman/pods/create.go
@@ -224,7 +224,8 @@ func create(cmd *cobra.Command, args []string) error {
}
sort.Ints(vals)
for ind, core := range vals {
- if core > int(cpuSet) {
+ switch {
+ case core > int(cpuSet):
if copy == "" {
copy = "0-" + strconv.Itoa(int(cpuSet))
infraOptions.CPUSetCPUs = copy
@@ -233,9 +234,9 @@ func create(cmd *cobra.Command, args []string) error {
infraOptions.CPUSetCPUs = copy
break
}
- } else if ind != 0 {
+ case ind != 0:
copy += "," + strconv.Itoa(core)
- } else {
+ default:
copy = "" + strconv.Itoa(core)
}
}