Skip to content

Commit

Permalink
libcontainer: remove isPidsSet because it should always be set
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hunt <pehunt@redhat.com>
  • Loading branch information
haircommander committed Sep 12, 2023
1 parent 670474e commit fefc1d3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion libcontainer/cgroups/fs2/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func needAnyControllers(r *configs.Resources) (bool, error) {
return ok
}

if isPidsSet(r) && have("pids") {
if have("pids") {
return true, nil
}
if isMemorySet(r) && have("memory") {
Expand Down
4 changes: 0 additions & 4 deletions libcontainer/cgroups/fs2/pids.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ import (
"github.com/opencontainers/runc/libcontainer/configs"
)

func isPidsSet(r *configs.Resources) bool {
return r.PidsLimit != 0
}

func setPids(dirPath string, r *configs.Resources) error {
if val := numToStr(r.PidsLimit); val != "" {
if err := cgroups.WriteFile(dirPath, "pids.max", val); err != nil {
Expand Down

0 comments on commit fefc1d3

Please sign in to comment.