Skip to content

Replace docker inspect with list filter

What does this MR do and why?

When using docker inspect, if a resource does not exist the command exits with an error exit status.
However this causes our tests to log an error message which can cause confusion for some when debugging test failure issues.
e.g. https://gitlab.com/gitlab-org/gitlab-qa-mirror/-/jobs/2763524399#L118

[Jul 25 2022 04:39:34 UTC (Gitlab QA)] INFO  -- Docker shell command: `docker network inspect test`
[Jul 25 2022 04:39:34 UTC (Gitlab QA)] ERROR -- Docker shell command output:
[]
Error: No such network: test
[Jul 25 2022 04:39:34 UTC (Gitlab QA)] INFO  -- Docker shell command: `docker network create test`

To mitigate against this, let's instead consider using a list command with a filter which should avoid logging errors which are part of the 'expected' flow.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by George Koltsov

Merge request reports