Skip to content

Commit

Permalink
dockerized_execution: Clean broken .cache folder references
Browse files Browse the repository at this point in the history
Running dockerized tests while having bazel cache references in your
repository folder could lead to errors like this:
"<path> is not in the subpath of '/git'"

This change fixes that by removing any broken links to this
.cache folder of the base host from the mounted repository root.

Change-Id: Ib0c82d588f67d3b261d55103d0b37d10524f3d83
(cherry picked from commit 6807202482a4ab83c11f6343cac789d4ef8e868e)
  • Loading branch information
rene-slowenski-checkmk committed Feb 13, 2025
1 parent 4ec439b commit d8e1de7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/testlib/script_helpers/dockerized_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,9 @@ def _prepare_git_overlay(
],
)

# remove any broken links in the repository (e.g. invalid bazel cache references)
_exec_run(container, ["find", target_path, "-maxdepth", "1", "-xtype", "l", "-delete"])

# target_path belongs to root, but its content belong to testuser. Newer git versions don't like
# that by default, so we explicitly say that this is ok.
_exec_run(
Expand Down

0 comments on commit d8e1de7

Please sign in to comment.