Skip to content

Commit

Permalink
Merge pull request #14916 from rhatdan/docker
Browse files Browse the repository at this point in the history
Docker uses "-c" to mean "--cpu-shares" in create and run
  • Loading branch information
openshift-ci[bot] authored Jul 13, 2022
2 parents 255740b + c9a82d7 commit 6323af7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/podman/common/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -849,9 +849,9 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions,
_ = cmd.RegisterFlagCompletionFunc(cpuRtRuntimeFlagName, completion.AutocompleteNone)

cpuSharesFlagName := "cpu-shares"
createFlags.Uint64Var(
createFlags.Uint64VarP(
&cf.CPUShares,
cpuSharesFlagName, 0,
cpuSharesFlagName, "c", 0,
"CPU shares (relative weight)",
)
_ = cmd.RegisterFlagCompletionFunc(cpuSharesFlagName, completion.AutocompleteNone)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/markdown/podman-container-clone.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The sum of all runtimes across containers cannot exceed the amount allotted to t

This option is not supported on cgroups V2 systems.

#### **--cpu-shares**=*shares*
#### **--cpu-shares**, **-c**=*shares*

CPU shares (relative weight)

Expand Down
2 changes: 1 addition & 1 deletion docs/source/markdown/podman-create.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ The sum of all runtimes across containers cannot exceed the amount allotted to t

This flag is not supported on cgroups V2 systems.

#### **--cpu-shares**=*shares*
#### **--cpu-shares**, **-c**=*shares*

CPU shares (relative weight)

Expand Down
2 changes: 1 addition & 1 deletion docs/source/markdown/podman-run.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ The sum of all runtimes across containers cannot exceed the amount allotted to t

This flag is not supported on cgroups V2 systems.

#### **--cpu-shares**=*shares*
#### **--cpu-shares**, **-c**=*shares*

CPU shares (relative weight).

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/run_cpu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ var _ = Describe("Podman run cpu", func() {
Expect(result).Should(Exit(0))
Expect(result.OutputToString()).To(Equal("10000"))
} else {
result := podmanTest.Podman([]string{"run", "--rm", "--cpu-shares=2", ALPINE, "cat", "/sys/fs/cgroup/cpu/cpu.shares"})
result := podmanTest.Podman([]string{"run", "--rm", "-c", "2", ALPINE, "cat", "/sys/fs/cgroup/cpu/cpu.shares"})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Expect(result.OutputToString()).To(Equal("2"))
Expand Down

0 comments on commit 6323af7

Please sign in to comment.