Skip to content

Commit

Permalink
Exclude /run/host-services When Using Docker Desktop on MacOS
Browse files Browse the repository at this point in the history
* Docker Desktop takes care of setting up ssh-agent forwarding from MacOS but does in a way that is only allowed to `root` inside the container
* As documented at the time of commit at https://docs.docker.com/desktop/networking/#ssh-agent-forwarding
* Move the `None` check ahead of the path checking with a specific error message to clearly differentiate that error from path checking errors
  • Loading branch information
timway committed Aug 10, 2023
1 parent 63da714 commit f042704
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ansible_runner/config/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,14 @@ def _get_playbook_path(self, cmdline_args):
def _update_volume_mount_paths(
self, args_list, src_mount_path, dst_mount_path=None, labels=None
):
if src_mount_path is None:
logger.debug("Source volume mount path was not provided")
return

if src_mount_path is None or not os.path.exists(src_mount_path):
logger.debug("Source volume mount path does not exist: %s", src_mount_path)
if not os.path.exists(src_mount_path) and not (
self.containerized and self.process_isolation_executable == "docker" and os.path.abspath(src_mount_path).startswith("/run/host-services")
):
logger.debug("Source volume mount path does not exit {0}".format(src_mount_path))
return

# ensure source is abs
Expand Down

0 comments on commit f042704

Please sign in to comment.