Add support for kata-agent #153
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
manager: Make FsManager and SystemdManager serializable
The kata-agent (de)serializes managers in child initialization. The
oci
feature relies on
serde
crate to provide the ability to serialize.Zbus's value uses variable reference, which is hard to serialize.
Value
is introduced to take the ownership of the value, so that we can remove
lifetime annotations from
SystemdClient
, also fromSystemdManager
.The types supported by the
Value
only include the types that are in use.Later on, more types can be added to
Value
if needed.manager: Add Debug trait for Manager
Both
FsManager
andSystemdManger
supportDebug
trait, so we can addit to
Manager
as well.cgroups-rs: Enhance CgroupPid
Implement
From<u32>
andFrom<i32>
forCgroupPid
to allow conversionfrom these types directly. Add
as_raw()
method to retrieve the raw PIDvalue, and add
set()
method to modify the PID value.manager: Make create_cgroups() public
The kata-agent expects to create sandbox cgroup without need to wait for
the first process/thread to be added to the cgroup.
manager: Add devices cgroup stats
The stats allow users to retrieve device whitelist from the cgroupfs.
manager: Skip resources whose controller doesn't exist
Not all cgroup controllers are available, so we should skip setting cgroups
for those controllers.