Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker uses "-c" to mean "--cpu-shares" in create and run #14916

Merged
merged 1 commit into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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