Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fake "podman network exists" command #613

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Jan 4, 2023

  1. Add fake "podman network exists" command

    Motivation:
    
    podman-compose uses the "podman network exists" command to avoid
    creating the same network twice.  This command was added with podman
    v3.1.0.
    
    Debian stable has an older version of podman (v3.0.1) that doesn't
    support the "podman network exists" command.
    
    A symptom of this problem is podman-compose failing with lines like:
    
        subprocess.CalledProcessError: Command '['podman', 'network', 'exists', 'scicatlive_default']' returned non-zero exit status 125.
    
        During handling of the above exception, another exception occurred:
    
        [...]
        subprocess.CalledProcessError: Command '['podman', 'network', 'create', '--labelect=scicatlive', 'scicatlive_default']' returned non-zero exit status 125.
    
    Modification:
    
    Abstract the two places where podman-compose checks if a network already
    exists.  This is now handled by a specific method.
    
    Check the podman version.  If the podman version is earlier than v3.1.0
    then simulate the "podman network exists" command by parsing the output
    from "podman network ls", otherwise simply call the "podman network
    exists" command directly.
    
    Result:
    
    podman-compose is now able to create a network with versions of podman
    before v3.1.0.
    
    Signed-off-by: Paul Millar <[email protected]>
    paulmillar committed Jan 4, 2023
    Configuration menu
    Copy the full SHA
    1d1bae9 View commit details
    Browse the repository at this point in the history