Skip to content

Commit 3564d6a

Browse files
author
Nathan Brake
committed
pr review
1 parent ef5754c commit 3564d6a

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/session/instance.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,11 +817,21 @@ impl Instance {
817817

818818
// Filter anonymous_volumes to exclude paths that conflict with extra_volumes
819819
// (extra_volumes should take precedence over volume_ignores)
820+
// Conflicts include:
821+
// - Exact match: both point to same path
822+
// - Anonymous volume is parent of extra_volume (would shadow the mount)
823+
// - Anonymous volume is inside extra_volume (redundant/conflicting)
820824
let anonymous_volumes: Vec<String> = sandbox_config
821825
.volume_ignores
822826
.iter()
823827
.map(|ignore| format!("{}/{}", workspace_path, ignore))
824-
.filter(|path| !extra_volume_container_paths.contains(path))
828+
.filter(|anon_path| {
829+
!extra_volume_container_paths.iter().any(|extra_path| {
830+
anon_path == extra_path
831+
|| extra_path.starts_with(&format!("{}/", anon_path))
832+
|| anon_path.starts_with(&format!("{}/", extra_path))
833+
})
834+
})
825835
.collect();
826836

827837
Ok(ContainerConfig {

0 commit comments

Comments
 (0)