mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Restructure use of options
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č <mitr@redhat.com>
This commit is contained in:
@ -24,32 +24,34 @@ func IsRemote() bool {
|
|||||||
|
|
||||||
// Podman is the exec call to podman on the filesystem
|
// Podman is the exec call to podman on the filesystem
|
||||||
func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration {
|
func (p *PodmanTestIntegration) Podman(args []string) *PodmanSessionIntegration {
|
||||||
args = p.makeOptions(args, PodmanExecOptions{})
|
options := PodmanExecOptions{}
|
||||||
podmanSession := p.PodmanExecBaseWithOptions(args, PodmanExecOptions{})
|
args = p.makeOptions(args, options)
|
||||||
|
podmanSession := p.PodmanExecBaseWithOptions(args, options)
|
||||||
return &PodmanSessionIntegration{podmanSession}
|
return &PodmanSessionIntegration{podmanSession}
|
||||||
}
|
}
|
||||||
|
|
||||||
// PodmanSystemdScope runs the podman command in a new systemd scope
|
// PodmanSystemdScope runs the podman command in a new systemd scope
|
||||||
func (p *PodmanTestIntegration) PodmanSystemdScope(args []string) *PodmanSessionIntegration {
|
func (p *PodmanTestIntegration) PodmanSystemdScope(args []string) *PodmanSessionIntegration {
|
||||||
args = p.makeOptions(args, PodmanExecOptions{})
|
|
||||||
|
|
||||||
wrapper := []string{"systemd-run", "--scope"}
|
wrapper := []string{"systemd-run", "--scope"}
|
||||||
if isRootless() {
|
if isRootless() {
|
||||||
wrapper = []string{"systemd-run", "--scope", "--user"}
|
wrapper = []string{"systemd-run", "--scope", "--user"}
|
||||||
}
|
}
|
||||||
|
options := PodmanExecOptions{
|
||||||
podmanSession := p.PodmanExecBaseWithOptions(args, PodmanExecOptions{
|
|
||||||
Wrapper: wrapper,
|
Wrapper: wrapper,
|
||||||
})
|
}
|
||||||
|
|
||||||
|
args = p.makeOptions(args, options)
|
||||||
|
podmanSession := p.PodmanExecBaseWithOptions(args, options)
|
||||||
return &PodmanSessionIntegration{podmanSession}
|
return &PodmanSessionIntegration{podmanSession}
|
||||||
}
|
}
|
||||||
|
|
||||||
// PodmanExtraFiles is the exec call to podman on the filesystem and passes down extra files
|
// 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 {
|
func (p *PodmanTestIntegration) PodmanExtraFiles(args []string, extraFiles []*os.File) *PodmanSessionIntegration {
|
||||||
args = p.makeOptions(args, PodmanExecOptions{})
|
options := PodmanExecOptions{
|
||||||
podmanSession := p.PodmanExecBaseWithOptions(args, PodmanExecOptions{
|
|
||||||
ExtraFiles: extraFiles,
|
ExtraFiles: extraFiles,
|
||||||
})
|
}
|
||||||
|
args = p.makeOptions(args, options)
|
||||||
|
podmanSession := p.PodmanExecBaseWithOptions(args, options)
|
||||||
return &PodmanSessionIntegration{podmanSession}
|
return &PodmanSessionIntegration{podmanSession}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user