Add kata containers support

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh 2020-03-27 06:35:14 -04:00
parent ac6db2fcba
commit 4bb3c87228
4 changed files with 29 additions and 3 deletions

View File

@ -314,7 +314,7 @@ Pull image before running or creating a container. The default is **missing**.
Default OCI specific runtime in runtimes that will be used by default. Must
refer to a member of the runtimes table.
**runtime_supports_json**=["crun", "runc"]
**runtime_supports_json**=["crun", "runc", "kata"]
The list of the OCI runtimes that support `--format=json`.
**runtime_supports_nocgroups**=["crun"]

View File

@ -256,6 +256,15 @@ var _ = Describe("Config", func() {
defaultConfig, err := readConfigFromFile("testdata/containers_default.conf", conf)
OCIRuntimeMap := map[string][]string{
"kata": {
"/usr/bin/kata-runtime",
"/usr/sbin/kata-runtime",
"/usr/local/bin/kata-runtime",
"/usr/local/sbin/kata-runtime",
"/sbin/kata-runtime",
"/bin/kata-runtime",
},
"runc": {
"/usr/bin/runc",
"/usr/sbin/runc",

View File

@ -345,9 +345,9 @@
# List of the OCI runtimes that support --format=json. When json is supported
# engine will use it for reporting nicer errors.
#
# runtime_supports_json = ["crun", "runc"]
# runtime_supports_json = ["crun", "runc", "kata"]
# Paths to look for a valid OCI runtime (runc, runv, etc)
# Paths to look for a valid OCI runtime (runc, runv, kata, etc)
[engine.runtimes]
# runc = [
# "/usr/bin/runc",
@ -369,6 +369,15 @@
# "/run/current-system/sw/bin/crun",
# ]
# kata = [
# "/usr/bin/kata-runtime",
# "/usr/sbin/kata-runtime",
# "/usr/local/bin/kata-runtime",
# "/usr/local/sbin/kata-runtime",
# "/sbin/kata-runtime",
# "/bin/kata-runtime",
# ]
# Number of seconds to wait for container to exit before sending kill signal.
#stop_timeout = 10

View File

@ -234,6 +234,14 @@ func defaultConfigFromMemory() (*EngineConfig, error) {
"/bin/crun",
"/run/current-system/sw/bin/crun",
},
"kata": {
"/usr/bin/kata-runtime",
"/usr/sbin/kata-runtime",
"/usr/local/bin/kata-runtime",
"/usr/local/sbin/kata-runtime",
"/sbin/kata-runtime",
"/bin/kata-runtime",
},
}
c.ConmonEnvVars = []string{
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",