Skip to content

Log warn message when networksManager is not defined

What does this MR do?

Log warn message when networksManager is not defined

Why was this MR needed?

When the networksManager is not defined the clean up will return an errNetworksManagerUndefined in https://gitlab.com/gitlab-org/gitlab-runner/-/blob/master/executors/docker/docker.go#L630-632. This will check the error type and it will not log it as an Error but a Warning.

This can be a common case where Cleanup is called in the middle of Prepare execution, for example when the user cancels the build. We saw such case in #22485 (comment 303769660).

Tests are a bit hard to add since we don't have the correct logging setup for the Builder logger and we can't mock it. This could be greatly improved in #6609

Testing

Before: Screen_Shot_2020-03-12_at_11.50.55

After: Screen_Shot_2020-03-12_at_11.51.33

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

Closes #22485

Merge request reports