Skip to content

docker warnings break parsing of docker output. #17

Description

@rukai

warnings generated by docker-compose.yaml issues will cause failures to parse docker output.
For example, consider this snippet from the crate:

        let containers = run_command(
            "docker",
            &["compose", "-f", file_path, "ps", "--status", status],
        )
        .unwrap();
        // One line for the table heading. If there are more lines then there is some data indicating that containers exist with this status
        if containers.matches('\n').count() > 1 {
            panic!(
                "At least one container failed to initialize\n{containers}\nFull log\n{full_log}"
            );
        }

If a warning is emitted an extra line will be included causing the if statement to run when it should not run.

We need to fix this case to handle warnings AND check for other cases where we might be parsing output and need to ignore warnings.

An example method for reproducing the issue is adding the version: '3' field to the top of the yaml, this will trigger a deprecation warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions