From ce1b4f72a708ea5974fce4fd884eae92299d0c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Wed, 22 Jan 2025 22:54:39 +0100 Subject: [PATCH] Restructure use of options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pass exactly the same PodmanExecOptions to makeOptions and to PodmanExecBaseWithOptions. This will allow simplifying the code further. Should not change behavior. Signed-off-by: Miloslav Trmač --- test/e2e/libpod_suite_remote_test.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/test/e2e/libpod_suite_remote_test.go b/test/e2e/libpod_suite_remote_test.go index 90ac22171a..0d5568f0be 100644 --- a/test/e2e/libpod_suite_remote_test.go +++ b/test/e2e/libpod_suite_remote_test.go @@ -24,32 +24,34 @@ func IsRemote() bool { // Podman is the exec call to podman on the filesystem func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration { - args = p.makeOptions(args, PodmanExecOptions{}) - podmanSession := p.PodmanExecBaseWithOptions(args, PodmanExecOptions{}) + options := PodmanExecOptions{} + args = p.makeOptions(args, options) + podmanSession := p.PodmanExecBaseWithOptions(args, options) return &PodmanSessionIntegration{podmanSession} } // PodmanSystemdScope runs the podman command in a new systemd scope func (p *PodmanTestIntegration) PodmanSystemdScope(args []string) *PodmanSessionIntegration { - args = p.makeOptions(args, PodmanExecOptions{}) - wrapper := []string{"systemd-run", "--scope"} if isRootless() { wrapper = []string{"systemd-run", "--scope", "--user"} } - - podmanSession := p.PodmanExecBaseWithOptions(args, PodmanExecOptions{ + options := PodmanExecOptions{ Wrapper: wrapper, - }) + } + + args = p.makeOptions(args, options) + podmanSession := p.PodmanExecBaseWithOptions(args, options) return &PodmanSessionIntegration{podmanSession} } // 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 { - args = p.makeOptions(args, PodmanExecOptions{}) - podmanSession := p.PodmanExecBaseWithOptions(args, PodmanExecOptions{ + options := PodmanExecOptions{ ExtraFiles: extraFiles, - }) + } + args = p.makeOptions(args, options) + podmanSession := p.PodmanExecBaseWithOptions(args, options) return &PodmanSessionIntegration{podmanSession} }