Skip to content

Commit

Permalink
chore: align rlimit
Browse files Browse the repository at this point in the history
  • Loading branch information
nixpig committed Dec 9, 2024
1 parent b6e64e6 commit c22f408
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions container/container_init.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package container

import (
"errors"
"fmt"
"os"
"os/exec"
Expand Down Expand Up @@ -170,10 +169,9 @@ func (c *Container) Init(reexec string, arg string, log *zerolog.Logger) error {
}

if c.Spec.Process != nil && c.Spec.Process.Rlimits != nil {
for _, rl := range c.Spec.Process.Rlimits {
if _, ok := cgroups.Rlimits[rl.Type]; !ok {
return errors.New("unable to map rlimit to kernel interface")
}
if err := cgroups.SetRlimits(c.Spec.Process.Rlimits); err != nil {
log.Error().Err(err).Msg("set rlimits")
return err
}
}

Expand Down

0 comments on commit c22f408

Please sign in to comment.