Restore persistent system path composition
This commit is contained in:
parent
84bb22a7db
commit
7aff8e542e
1 changed files with 338 additions and 30 deletions
|
|
@ -25,6 +25,7 @@ use crate::network::{
|
|||
NetworkAttestationContext, PreparedNetwork, enter_generation_filesystem_namespaces,
|
||||
enter_generation_network_namespace, prepare_network,
|
||||
};
|
||||
use crate::sandbox::RUNTIME_FILE_DESTINATIONS;
|
||||
|
||||
use super::runtime::{
|
||||
attached_runsc_standard_io, fail_network, fail_runtime_components, fail_with_runtime_cleanup,
|
||||
|
|
@ -134,6 +135,19 @@ fn prepare_state_anchor(
|
|||
mount
|
||||
.require_persistent_destinations(&state.persistent_destinations)
|
||||
.map_err(io::Error::other)?;
|
||||
let transient_targets = RUNTIME_FILE_DESTINATIONS
|
||||
.iter()
|
||||
.map(|(_, destination)| PathBuf::from(destination.trim_start_matches('/')))
|
||||
.filter(|target| {
|
||||
state
|
||||
.persistent_destinations
|
||||
.iter()
|
||||
.any(|persistent| target.starts_with(persistent) && target != persistent)
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
mount
|
||||
.require_transient_override_targets(&transient_targets)
|
||||
.map_err(io::Error::other)?;
|
||||
Ok(Some(mount))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue