Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

udev: Add devnode to mounts not devpath #562

Merged
merged 2 commits into from
Apr 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions discovery-handlers/udev/src/discovery_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,23 @@ impl DiscoveryHandler for DiscoveryHandlerImpl {
.into_iter()
.map(|(path, node)| {
let mut properties = std::collections::HashMap::new();
let mut mounts = Vec::new();
if let Some(devnode) = node {
properties.insert(super::UDEV_DEVNODE_LABEL_ID.to_string(), devnode);
properties
.insert(super::UDEV_DEVNODE_LABEL_ID.to_string(), devnode.clone());
mounts.push(Mount {
container_path: devnode.clone(),
host_path: devnode,
read_only: true,
});
}
properties.insert(super::UDEV_DEVPATH_LABEL_ID.to_string(), path.clone());
let mount = Mount {
container_path: path.clone(),
host_path: path.clone(),
read_only: true,
};

// TODO: use device spec
Device {
id: path,
properties,
mounts: vec![mount],
mounts,
device_specs: Vec::default(),
}
})
Expand Down