Skip to content

Fix duplicate volume check with trailing slash

Pedro Pombeiro requested to merge 25432-fix-duplicate-mount-point into master

What does this MR do?

This MR fixes a regression introduced in !1989 (merged) by avoiding creating build dir volume if the Runner configuration already contains a a non-normalized mapping for that volume.

Why was this MR needed?

Before !1989 (merged), we were creating a container specifically to hold the build dir mapping, and then adding the volumes from that container to the runner container. Apparently, Docker doesn't complain when importing duplicate volumes from another container, so we were relying on an accidental feature when our own check failed due to comparing a normalised path with the user's non-normalised one. With the change to use volume mounts instead, the problem of having the same container directory mapped twice became evident.

With this MR, we normalise the volume mount point paths before checking them and adding them to the map, so we avoid false negatives.

Are there points in the code the reviewer needs to double check?

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 #25432 (closed)

Edited by Yorick Peterse

Merge request reports