Skip to content

Commit

Permalink
Do not skip mounts with source == destination for docker-in-docker mode
Browse files Browse the repository at this point in the history
Remove now useless test
  • Loading branch information
romainreignier committed Apr 16, 2020
1 parent 2ddc30f commit 56accbe
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 56accbe

Please sign in to comment.