From eb1227f47d2542e75eb3a96df93bfae4bbb25b03 Mon Sep 17 00:00:00 2001 From: Pavel Mores Date: Fri, 30 Aug 2024 17:18:00 +0200 Subject: [PATCH] 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 --- src/libs/kata-types/src/config/hypervisor/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libs/kata-types/src/config/hypervisor/mod.rs b/src/libs/kata-types/src/config/hypervisor/mod.rs index f5fff4ba06..d9bf095f5c 100644 --- a/src/libs/kata-types/src/config/hypervisor/mod.rs +++ b/src/libs/kata-types/src/config/hypervisor/mod.rs @@ -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 {