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

docker warnings break parsing of docker output. #17

Open
rukai opened this issue Apr 1, 2024 · 0 comments
Open

docker warnings break parsing of docker output. #17

rukai opened this issue Apr 1, 2024 · 0 comments

Comments

@rukai
Copy link
Member

rukai commented Apr 1, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant