mirror of
https://github.com/containers/podman.git
synced 2025-05-21 00:56:36 +08:00
Eliminate PodmanExtraFiles
Instaed, inline the implementation into callers, calling PodmanWithOptions directly, demonstrating how to use PodmanWithOptions. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
@ -457,7 +457,9 @@ var _ = Describe("Podman exec", func() {
|
|||||||
files := []*os.File{
|
files := []*os.File{
|
||||||
devNull,
|
devNull,
|
||||||
}
|
}
|
||||||
session := podmanTest.PodmanExtraFiles([]string{"exec", "--preserve-fds", "1", "test1", "ls"}, files)
|
session := podmanTest.PodmanWithOptions(PodmanExecOptions{
|
||||||
|
ExtraFiles: files,
|
||||||
|
}, "exec", "--preserve-fds", "1", "test1", "ls")
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
})
|
})
|
||||||
|
@ -45,13 +45,6 @@ func (p *PodmanTestIntegration) PodmanSystemdScope(args []string) *PodmanSession
|
|||||||
}, args...)
|
}, args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PodmanExtraFiles is the exec call to podman on the filesystem and passes down extra files
|
|
||||||
func (p *PodmanTestIntegration) PodmanExtraFiles(args []string, extraFiles []*os.File) *PodmanSessionIntegration {
|
|
||||||
return p.PodmanWithOptions(PodmanExecOptions{
|
|
||||||
ExtraFiles: extraFiles,
|
|
||||||
}, args...)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *PodmanTestIntegration) setDefaultRegistriesConfigEnv() {
|
func (p *PodmanTestIntegration) setDefaultRegistriesConfigEnv() {
|
||||||
defaultFile := "registries.conf"
|
defaultFile := "registries.conf"
|
||||||
if UsingCacheRegistry() {
|
if UsingCacheRegistry() {
|
||||||
|
@ -37,13 +37,6 @@ func (p *PodmanTestIntegration) PodmanSystemdScope(args []string) *PodmanSession
|
|||||||
}, args...)
|
}, args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PodmanExtraFiles is the exec call to podman on the filesystem and passes down extra files
|
|
||||||
func (p *PodmanTestIntegration) PodmanExtraFiles(args []string, extraFiles []*os.File) *PodmanSessionIntegration {
|
|
||||||
return p.PodmanWithOptions(PodmanExecOptions{
|
|
||||||
ExtraFiles: extraFiles,
|
|
||||||
}, args...)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *PodmanTestIntegration) setDefaultRegistriesConfigEnv() {
|
func (p *PodmanTestIntegration) setDefaultRegistriesConfigEnv() {
|
||||||
defaultFile := "registries.conf"
|
defaultFile := "registries.conf"
|
||||||
if UsingCacheRegistry() {
|
if UsingCacheRegistry() {
|
||||||
|
@ -1849,7 +1849,9 @@ VOLUME %s`, ALPINE, volPath, volPath)
|
|||||||
files := []*os.File{
|
files := []*os.File{
|
||||||
devNull,
|
devNull,
|
||||||
}
|
}
|
||||||
session := podmanTest.PodmanExtraFiles([]string{"run", "--preserve-fds", "1", ALPINE, "ls"}, files)
|
session := podmanTest.PodmanWithOptions(PodmanExecOptions{
|
||||||
|
ExtraFiles: files,
|
||||||
|
}, "run", "--preserve-fds", "1", ALPINE, "ls")
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(ExitCleanly())
|
Expect(session).Should(ExitCleanly())
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user