mirror of
https://github.com/containers/podman.git
synced 2025-06-25 03:52:15 +08:00
Merge pull request #7573 from rhatdan/oom
Make oom-score-adj actually work
This commit is contained in:
@ -353,6 +353,9 @@ func SpecGenToOCI(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Runt
|
||||
configSpec.Annotations[define.InspectAnnotationInit] = define.InspectResponseFalse
|
||||
}
|
||||
|
||||
if s.OOMScoreAdj != nil {
|
||||
g.SetProcessOOMScoreAdj(*s.OOMScoreAdj)
|
||||
}
|
||||
setProcOpts(s, &g)
|
||||
|
||||
return configSpec, nil
|
||||
|
@ -325,10 +325,10 @@ USER bin`
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
}
|
||||
|
||||
session = podmanTest.Podman([]string{"run", "--rm", "--oom-score-adj=100", fedoraMinimal, "cat", "/proc/self/oom_score_adj"})
|
||||
session = podmanTest.Podman([]string{"run", "--rm", "--oom-score-adj=111", fedoraMinimal, "cat", "/proc/self/oom_score_adj"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session.ExitCode()).To(Equal(0))
|
||||
Expect(session.OutputToString()).To(ContainSubstring("100"))
|
||||
Expect(session.OutputToString()).To(Equal("111"))
|
||||
})
|
||||
|
||||
It("podman run limits host test", func() {
|
||||
|
Reference in New Issue
Block a user