kata-deploy: Propagate drop-in configs to custom runtime classes

Ensure custom runtime classes receive the same drop-in configuration
files as standard runtimes:
- 10-installation-prefix.toml (if custom dest_dir)
- 20-debug.toml (if debug enabled)
- 30-kernel-params.toml (proxy + debug kernel params)

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
This commit is contained in:
Fabiano Fidêncio
2026-02-04 15:12:57 +01:00
parent 8c60a88bda
commit 577aa6b319

View File

@@ -145,6 +145,8 @@ pub async fn remove_artifacts(config: &Config) -> Result<()> {
}
/// Each custom runtime gets an isolated directory under custom-runtimes/{handler}/
/// Custom runtimes inherit the same drop-in configurations as standard runtimes
/// (installation prefix, debug, kernel_params) plus any user-provided overrides.
fn install_custom_runtime_configs(config: &Config) -> Result<()> {
info!("Installing custom runtime configuration files");
@@ -190,7 +192,27 @@ fn install_custom_runtime_configs(config: &Config) -> Result<()> {
);
}
// Copy drop-in file if provided
// Generate the same drop-in files that standard runtimes get
// Use the base_config as the shim for hypervisor name resolution
let shim = &runtime.base_config;
// 1. Installation prefix adjustments (if not default)
if config.dest_dir != "/opt/kata" {
let prefix_content = generate_installation_prefix_drop_in(config, shim)?;
write_drop_in_file(&config_d_dir, "10-installation-prefix.toml", &prefix_content)?;
}
// 2. Debug configuration (boolean flags only via drop-in)
if config.debug {
let debug_content = generate_debug_drop_in(shim)?;
write_drop_in_file(&config_d_dir, "20-debug.toml", &debug_content)?;
}
// 3. Combined kernel_params (proxy, debug, etc.)
let kernel_params_content = generate_kernel_params_drop_in(config, shim)?;
write_drop_in_file(&config_d_dir, "30-kernel-params.toml", &kernel_params_content)?;
// Copy user-provided drop-in file if provided (at 50-overrides.toml)
if let Some(ref drop_in_src) = runtime.drop_in_file {
let drop_in_dest = format!("{}/50-overrides.toml", config_d_dir);