fix: 'cgroup-manager' is not assigned while creating container
make 'disabled' as the default value of field 'cgroup-manager' Signed-off-by: ComixHe <ComixHe1895@outlook.com>
This commit is contained in:
parent
489cc336e4
commit
aa58f981ef
|
|
@ -34,4 +34,23 @@ private:
|
|||
cgroup_manager_t manager;
|
||||
};
|
||||
|
||||
inline std::ostream &operator<<(std::ostream &os, cgroup_manager_t manager)
|
||||
{
|
||||
switch (manager) {
|
||||
case cgroup_manager_t::disabled: {
|
||||
os << "disabled";
|
||||
} break;
|
||||
case cgroup_manager_t::systemd: {
|
||||
os << "systemd";
|
||||
} break;
|
||||
case cgroup_manager_t::cgroupfs: {
|
||||
os << "cgroupfs";
|
||||
} break;
|
||||
default:
|
||||
os << "unknown";
|
||||
}
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace linyaps_box
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ linyaps_box::command::options linyaps_box::command::parse(int argc, char *argv[]
|
|||
{ "systemd", cgroup_manager_t::systemd },
|
||||
{ "disabled", cgroup_manager_t::disabled },
|
||||
}))
|
||||
->default_val(cgroup_manager_t::cgroupfs);
|
||||
->default_val(cgroup_manager_t::disabled);
|
||||
|
||||
list_options list_opt{ options.global };
|
||||
auto *cmd_list = app.add_subcommand("list", "List know containers");
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace linyaps_box::command {
|
|||
|
||||
struct global_options
|
||||
{
|
||||
cgroup_manager_t manager{ cgroup_manager_t::cgroupfs };
|
||||
cgroup_manager_t manager{ cgroup_manager_t::disabled };
|
||||
std::filesystem::path root;
|
||||
int return_code{ 0 };
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ int linyaps_box::command::run(const struct run_options &options)
|
|||
create_container_options.bundle = options.bundle;
|
||||
create_container_options.config = options.config;
|
||||
create_container_options.ID = options.ID;
|
||||
create_container_options.manager = options.global.get().manager;
|
||||
|
||||
auto container = runtime.create_container(create_container_options);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue