Do not skip mounts with source == destination for docker-in-docker mode
Remove now useless test
@@ -257,13 +257,11 @@ 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
})
.unwrap_or_else(|| Vec::new())
@@ -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!([{
