mirror of https://github.com/containers/podman.git
Eliminate PodmanSystemdScope
It seems this utility is not all that generally useful, so eliminate it from the global namespace and use PodmanWithOptions directly. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
parent
9363c8c362
commit
df9e8c3ce6
|
@ -34,17 +34,6 @@ func (p *PodmanTestIntegration) PodmanWithOptions(options PodmanExecOptions, arg
|
|||
return &PodmanSessionIntegration{podmanSession}
|
||||
}
|
||||
|
||||
// PodmanSystemdScope runs the podman command in a new systemd scope
|
||||
func (p *PodmanTestIntegration) PodmanSystemdScope(args []string) *PodmanSessionIntegration {
|
||||
wrapper := []string{"systemd-run", "--scope"}
|
||||
if isRootless() {
|
||||
wrapper = []string{"systemd-run", "--scope", "--user"}
|
||||
}
|
||||
return p.PodmanWithOptions(PodmanExecOptions{
|
||||
Wrapper: wrapper,
|
||||
}, args...)
|
||||
}
|
||||
|
||||
func (p *PodmanTestIntegration) setDefaultRegistriesConfigEnv() {
|
||||
defaultFile := "registries.conf"
|
||||
if UsingCacheRegistry() {
|
||||
|
|
|
@ -26,17 +26,6 @@ func (p *PodmanTestIntegration) PodmanWithOptions(options PodmanExecOptions, arg
|
|||
return &PodmanSessionIntegration{podmanSession}
|
||||
}
|
||||
|
||||
// PodmanSystemdScope runs the podman command in a new systemd scope
|
||||
func (p *PodmanTestIntegration) PodmanSystemdScope(args []string) *PodmanSessionIntegration {
|
||||
wrapper := []string{"systemd-run", "--scope"}
|
||||
if isRootless() {
|
||||
wrapper = []string{"systemd-run", "--scope", "--user"}
|
||||
}
|
||||
return p.PodmanWithOptions(PodmanExecOptions{
|
||||
Wrapper: wrapper,
|
||||
}, args...)
|
||||
}
|
||||
|
||||
func (p *PodmanTestIntegration) setDefaultRegistriesConfigEnv() {
|
||||
defaultFile := "registries.conf"
|
||||
if UsingCacheRegistry() {
|
||||
|
|
|
@ -1704,7 +1704,13 @@ VOLUME %s`, ALPINE, volPath, volPath)
|
|||
}
|
||||
}
|
||||
|
||||
container := podmanTest.PodmanSystemdScope([]string{"run", "--rm", "--cgroups=split", ALPINE, "cat", "/proc/self/cgroup"})
|
||||
scopeOptions := PodmanExecOptions{
|
||||
Wrapper: []string{"systemd-run", "--scope"},
|
||||
}
|
||||
if isRootless() {
|
||||
scopeOptions.Wrapper = append(scopeOptions.Wrapper, "--user")
|
||||
}
|
||||
container := podmanTest.PodmanWithOptions(scopeOptions, "run", "--rm", "--cgroups=split", ALPINE, "cat", "/proc/self/cgroup")
|
||||
container.WaitWithDefaultTimeout()
|
||||
Expect(container).Should(Exit(0))
|
||||
checkLines(container.OutputToStringArray())
|
||||
|
@ -1713,7 +1719,7 @@ VOLUME %s`, ALPINE, volPath, volPath)
|
|||
ContainSubstring("Running as unit: "))) // systemd >= 255
|
||||
|
||||
// check that --cgroups=split is honored also when a container runs in a pod
|
||||
container = podmanTest.PodmanSystemdScope([]string{"run", "--rm", "--pod", "new:split-test-pod", "--cgroups=split", ALPINE, "cat", "/proc/self/cgroup"})
|
||||
container = podmanTest.PodmanWithOptions(scopeOptions, "run", "--rm", "--pod", "new:split-test-pod", "--cgroups=split", ALPINE, "cat", "/proc/self/cgroup")
|
||||
container.WaitWithDefaultTimeout()
|
||||
Expect(container).Should(Exit(0))
|
||||
checkLines(container.OutputToStringArray())
|
||||
|
|
Loading…
Reference in New Issue