Turn PodmanAsUserBase into PodmanExecBaseWithOptions

... replacing the many parameters with a struct with named fields.

This makes the meaning of parameters more explicit, and more importantly
it makes it easier to just edit _one_ of the parameters without requiring
specialized wrappers for every single case.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2025-01-22 22:13:52 +01:00
parent 55f7efc408
commit f2d552f5db
4 changed files with 50 additions and 21 deletions

View File

@ -1060,7 +1060,12 @@ func SkipIfNetavark(p *PodmanTestIntegration) {
// PodmanAsUser is the exec call to podman on the filesystem with the specified uid/gid and environment
func (p *PodmanTestIntegration) PodmanAsUser(args []string, uid, gid uint32, cwd string, env []string) *PodmanSessionIntegration {
podmanSession := p.PodmanAsUserBase(args, uid, gid, cwd, env, false, false, nil, nil)
podmanSession := p.PodmanExecBaseWithOptions(args, PodmanExecOptions{
UID: uid,
GID: gid,
CWD: cwd,
Env: env,
})
return &PodmanSessionIntegration{podmanSession}
}