Skip to content

Commit

Permalink
Merge #409
Browse files Browse the repository at this point in the history
409: Allow to mount host path in docker-in-docker mode r=reitermarkus a=romainreignier

As discussed here: #387 (comment)
The check is not needed to allow to mount paths that are mounted in the first docker with the same path.

Co-authored-by: Romain Reignier <[email protected]>
  • Loading branch information
bors[bot] and romainreignier authored May 3, 2020
2 parents de91808 + 56accbe commit b5509fc
Showing 1 changed file with 4 additions and 25 deletions.
29 changes: 4 additions & 25 deletions src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,10 @@ fn dockerinfo_parse_user_mounts(info: &serde_json::Value) -> Vec<MountDetail> {
for details in v {
let source = make_path(&details["Source"]);
let destination = make_path(&details["Destination"]);
if source != destination {
mounts.push(MountDetail {
source,
destination,
});
}
mounts.push(MountDetail {
source,
destination,
});
}
mounts
})
Expand Down Expand Up @@ -387,25 +385,6 @@ mod tests {
assert_eq!(want, actual);
}

#[test]
fn test_parse_user_mounts_remove_if_source_dest_eq() {
let actual = dockerinfo_parse_user_mounts(&json!([{
"Mounts": [
{
"Type": "bind",
"Source": "/var/run/docker.sock",
"Destination": "/var/run/docker.sock",
},
{
"Type": "bind",
"Source": "/mounted/path",
"Destination": "/mounted/path",
}
],
}]));
assert_eq!(Vec::<MountDetail>::new(), actual);
}

#[test]
fn test_parse_empty_user_mounts() {
let actual = dockerinfo_parse_user_mounts(&json!([{
Expand Down

0 comments on commit b5509fc

Please sign in to comment.