mirror of
https://github.com/containers/podman.git
synced 2025-06-24 19:42:56 +08:00
Merge pull request #11405 from Luap99/systemd-arg-case
make podman run --systemd case insensitive
This commit is contained in:
@ -453,7 +453,7 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *entities.ContainerCreateOptions
|
||||
s.ImageVolumeMode = "anonymous"
|
||||
}
|
||||
|
||||
s.Systemd = c.Systemd
|
||||
s.Systemd = strings.ToLower(c.Systemd)
|
||||
s.SdNotifyMode = c.SdNotifyMode
|
||||
if s.ResourceLimits == nil {
|
||||
s.ResourceLimits = &specs.LinuxResources{}
|
||||
|
@ -176,4 +176,21 @@ WantedBy=multi-user.target
|
||||
|
||||
Expect(session.OutputToString()).To(Not(ContainSubstring("noexec")))
|
||||
})
|
||||
|
||||
It("podman run --systemd arg is case insensitive", func() {
|
||||
session := podmanTest.Podman([]string{"run", "--rm", "--systemd", "Always", ALPINE, "echo", "test"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToString()).Should(Equal("test"))
|
||||
|
||||
session = podmanTest.Podman([]string{"run", "--rm", "--systemd", "True", ALPINE, "echo", "test"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToString()).Should(Equal("test"))
|
||||
|
||||
session = podmanTest.Podman([]string{"run", "--rm", "--systemd", "False", ALPINE, "echo", "test"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToString()).Should(Equal("test"))
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user