Skip to content

Commit

Permalink
lib: avoid duplicate mounts, #TASK-6445
Browse files Browse the repository at this point in the history
  • Loading branch information
pfurio committed Sep 27, 2024
1 parent 403902b commit 909426a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,13 @@ public static String buildCommandLine(String image, List<AbstractMap.SimpleEntry

if (inputBindings != null) {
// Mount management (bindings)
Set<String> inputBindingSet = new HashSet<>();
for (AbstractMap.SimpleEntry<String, String> binding : inputBindings) {
commandLine.append("--mount type=bind,source=\"").append(binding.getKey()).append("\",target=\"").append(binding.getValue())
.append("\",readonly ");
if (!inputBindingSet.contains(binding.getKey())) {
commandLine.append("--mount type=bind,source=\"").append(binding.getKey()).append("\",target=\"")
.append(binding.getValue()).append("\",readonly ");
inputBindingSet.add(binding.getKey());
}
}
}
commandLine.append("--mount type=bind,source=\"").append(outputBinding.getKey()).append("\",target=\"")
Expand Down

0 comments on commit 909426a

Please sign in to comment.