Skip to content

--podman-args passed arguments to subcommand instead of global as advertized #1316

@zhangyi-hu

Description

@zhangyi-hu

Describe the bug

Args after --podman-args will be passed to subcommand (e.g. images) instead of global.

To Reproduce

podman-compose --podman-args="--connection remote-hostname" images

Expected behavior
Correct results on the images for containers on the remote server

Actual behavior
Errored out

Output

$ podman-compose --version 
podman-compose version 1.5.0
podman version 4.9.3
$ podman-compose --podman-args="--connection remote-hostname" images
...
raise subprocess.CalledProcessError(p.returncode, " ".join(cmd_ls), stderr_data)
subprocess.CalledProcessError: Command 'podman images --connection remote-hostname --format table my_container {{.Repository}} {{.Tag}} {{.ID}} {{.Size}} -n my_image:latest' returned non-zero exit status 125.

As you can see, the command generated is :
podman images --connection remote-hostname --format table my_container {{.Repository}} {{.Tag}} {{.ID}} {{.Size}} -n my_image:latest

The --connection remote-hostname is added after the images subcommand instead of right after podman.

In contrast, if I use the raw podman command with the correct order of the args, the results are as expected:

$ podman --connection remote-hostname images
REPOSITORY                 TAG         IMAGE ID      CREATED      SIZE
docker.io/library/busybox  latest      beae173ccac6  3 years ago  1.46 MB

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions