From 4c61eaa93344917539df6bb5d4a926b188c2ed99 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Mon, 4 Feb 2019 11:13:08 -0800 Subject: [PATCH] Fixes #10643: Ensure paths are properly expanded when comparing synced folders Prior to this commit, the docker action would attempt to compare and validate synced folders based on their string value, rather than their actual path value. This commit updates that by path expanding the mounts when comparing a containers synced folders. --- .../providers/docker/action/compare_synced_folders.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/providers/docker/action/compare_synced_folders.rb b/plugins/providers/docker/action/compare_synced_folders.rb index 29d237f83..1284a21dd 100644 --- a/plugins/providers/docker/action/compare_synced_folders.rb +++ b/plugins/providers/docker/action/compare_synced_folders.rb @@ -32,14 +32,18 @@ module VagrantPlugins fs.each do |_, data| invalid = false old = existing.delete(data[:guestpath]) - invalid = true if !old + if !old + invalid = true + else + old = File.expand_path(old) + end if !invalid && old - invalid = true if old != data[:hostpath] + invalid = true if old != File.expand_path(data[:hostpath]) end if invalid - invalids[data[:guestpath]] = data[:hostpath] + invalids[File.expand_path(data[:guestpath])] = File.expand_path(data[:hostpath]) end end end