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:
Miloslav Trmač
2025-01-22 23:21:10 +01:00
parent 44c5767460
commit 9363c8c362
4 changed files with 6 additions and 16 deletions

View File

@ -457,7 +457,9 @@ var _ = Describe("Podman exec", func() {
files := []*os.File{
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()
Expect(session).Should(ExitCleanly())
})

View File

@ -45,13 +45,6 @@ func (p *PodmanTestIntegration) PodmanSystemdScope(args []string) *PodmanSession
}, 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() {
defaultFile := "registries.conf"
if UsingCacheRegistry() {

View File

@ -37,13 +37,6 @@ func (p *PodmanTestIntegration) PodmanSystemdScope(args []string) *PodmanSession
}, 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() {
defaultFile := "registries.conf"
if UsingCacheRegistry() {

View File

@ -1849,7 +1849,9 @@ VOLUME %s`, ALPINE, volPath, volPath)
files := []*os.File{
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()
Expect(session).Should(ExitCleanly())
})