mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-27 15:57:09 +00:00
agent/device: update_spec_device_list() should error if dev not found
If update_spec_device_list() is given a device that can't be found in the OCI spec, it currently does nothing, and returns Ok(()). That doesn't seem like what we'd expect and is not what the Go agent in Kata 1 does. Change it to return an error in that case, like Kata 1. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
a6d9fd4118
commit
230a9833f8
@ -262,10 +262,14 @@ fn update_spec_device_list(device: &Device, spec: &mut Spec) -> Result<()> {
|
||||
}
|
||||
}
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
Err(anyhow!(
|
||||
"Should have found a matching device {} in the spec",
|
||||
device.vm_path
|
||||
))
|
||||
}
|
||||
|
||||
// device.Id should be the predicted device name (vda, vdb, ...)
|
||||
|
Loading…
Reference in New Issue
Block a user