runtime-rs: parse the disable_guest_selinux config key

In order to handle the setting we have to first parse it and make its
value available to the rest of the program.

The yes() function is added to comply with serde which seems to insist
on default values being returned from functions.  Long term, this is
surely not the best place for this function to live, however given that
this is currently the first and only place where it's used it seems
appropriate to put it near its use.  If it ends up being reused elsewhere
a better place will surely emerge.

Signed-off-by: Pavel Mores <pmores@redhat.com>
This commit is contained in:
Pavel Mores 2024-08-30 17:18:00 +02:00 committed by Fabiano Fidêncio
parent 8789551fe6
commit eb1227f47d

View File

@ -1133,6 +1133,14 @@ pub struct Hypervisor {
/// Vendor customized runtime configuration.
#[serde(default, flatten)]
pub vendor: HypervisorVendor,
/// Disable applying SELinux on the container process.
#[serde(default = "yes")]
pub disable_guest_selinux: bool,
}
fn yes() -> bool {
true
}
impl Hypervisor {