refactor: streamline container setup and dependencies
- Remove `xz-utils` from initial package install - Remove password/secret check in `obj_init` - Add on-demand `crun` installation during container create - Import `herorunner_installer` for `crun` setup
This commit is contained in:
@@ -4,6 +4,7 @@ import freeflowuniverse.herolib.ui.console
|
||||
import freeflowuniverse.herolib.osal.core as osal
|
||||
import freeflowuniverse.herolib.core.pathlib
|
||||
import freeflowuniverse.herolib.core.texttools
|
||||
import freeflowuniverse.herolib.installers.virt.herorunner as herorunner_installer
|
||||
import os
|
||||
|
||||
// Updated enum to be more flexible
|
||||
@@ -73,6 +74,12 @@ pub fn (mut self ContainerFactory) new(args ContainerNewArgs) !&Container {
|
||||
// Create container config
|
||||
self.create_container_config(args.name, rootfs_path)!
|
||||
|
||||
// Install crun if not installed
|
||||
if !osal.cmd_exists('crun') {
|
||||
mut herorunner := herorunner_installer.new()!
|
||||
herorunner.install()!
|
||||
}
|
||||
|
||||
// Create container using crun
|
||||
osal.exec(
|
||||
cmd: 'crun create --bundle ${self.base_dir}/configs/${args.name} ${args.name}'
|
||||
|
||||
Reference in New Issue
Block a user