fix: use correct wasm shims names

Fix the wasm shim detection and the containerd configuration generation.

Prior to this commit, the binary and the `RuntimeType` values were not
correct.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
pull/9648/head
Flavio Castelli 2024-02-16 14:50:21 +01:00 committed by Brad Davidson
parent 2c4773a5aa
commit 64e4f0e6e7
2 changed files with 16 additions and 16 deletions

View File

@ -79,31 +79,31 @@ func findNvidiaContainerRuntimes(foundRuntimes runtimeConfigs) {
func findWasiRuntimes(foundRuntimes runtimeConfigs) { func findWasiRuntimes(foundRuntimes runtimeConfigs) {
potentialRuntimes := runtimeConfigs{ potentialRuntimes := runtimeConfigs{
"lunatic": { "lunatic": {
RuntimeType: "io.containerd.lunatic.v2", RuntimeType: "io.containerd.lunatic.v1",
BinaryName: "containerd-shim-lunatic-v1", BinaryName: "containerd-shim-lunatic-v1",
}, },
"slight": { "slight": {
RuntimeType: "io.containerd.slight.v2", RuntimeType: "io.containerd.slight.v1",
BinaryName: "containerd-shim-slight-v1", BinaryName: "containerd-shim-slight-v1",
}, },
"spin": { "spin": {
RuntimeType: "io.containerd.spin.v2", RuntimeType: "io.containerd.spin.v2",
BinaryName: "containerd-shim-spin-v1", BinaryName: "containerd-shim-spin-v2",
}, },
"wws": { "wws": {
RuntimeType: "io.containerd.wws.v2", RuntimeType: "io.containerd.wws.v1",
BinaryName: "containerd-shim-wws-v1", BinaryName: "containerd-shim-wws-v1",
}, },
"wasmedge": { "wasmedge": {
RuntimeType: "io.containerd.wasmedge.v2", RuntimeType: "io.containerd.wasmedge.v1",
BinaryName: "containerd-shim-wasmedge-v1", BinaryName: "containerd-shim-wasmedge-v1",
}, },
"wasmer": { "wasmer": {
RuntimeType: "io.containerd.wasmer.v2", RuntimeType: "io.containerd.wasmer.v1",
BinaryName: "containerd-shim-wasmer-v1", BinaryName: "containerd-shim-wasmer-v1",
}, },
"wasmtime": { "wasmtime": {
RuntimeType: "io.containerd.wasmtime.v2", RuntimeType: "io.containerd.wasmtime.v1",
BinaryName: "containerd-shim-wasmtime-v1", BinaryName: "containerd-shim-wasmtime-v1",
}, },
} }

View File

@ -44,7 +44,7 @@ func Test_UnitFindContainerRuntimes(t *testing.T) {
BinaryName: "/tmp/testExecutables/crun", BinaryName: "/tmp/testExecutables/crun",
}, },
"lunatic": { "lunatic": {
RuntimeType: "io.containerd.lunatic.v2", RuntimeType: "io.containerd.lunatic.v1",
BinaryName: "/tmp/testExecutables/containerd-shim-lunatic-v1", BinaryName: "/tmp/testExecutables/containerd-shim-lunatic-v1",
}, },
}, },
@ -57,7 +57,7 @@ func Test_UnitFindContainerRuntimes(t *testing.T) {
"containerd-shim-wasmtime-v1", "containerd-shim-wasmtime-v1",
"containerd-shim-lunatic-v1", "containerd-shim-lunatic-v1",
"containerd-shim-slight-v1", "containerd-shim-slight-v1",
"containerd-shim-spin-v1", "containerd-shim-spin-v2",
"containerd-shim-wws-v1", "containerd-shim-wws-v1",
"containerd-shim-wasmedge-v1", "containerd-shim-wasmedge-v1",
"containerd-shim-wasmer-v1", "containerd-shim-wasmer-v1",
@ -65,31 +65,31 @@ func Test_UnitFindContainerRuntimes(t *testing.T) {
}, },
want: runtimeConfigs{ want: runtimeConfigs{
"wasmtime": { "wasmtime": {
RuntimeType: "io.containerd.wasmtime.v2", RuntimeType: "io.containerd.wasmtime.v1",
BinaryName: "/tmp/testExecutables/containerd-shim-wasmtime-v1", BinaryName: "/tmp/testExecutables/containerd-shim-wasmtime-v1",
}, },
"lunatic": { "lunatic": {
RuntimeType: "io.containerd.lunatic.v2", RuntimeType: "io.containerd.lunatic.v1",
BinaryName: "/tmp/testExecutables/containerd-shim-lunatic-v1", BinaryName: "/tmp/testExecutables/containerd-shim-lunatic-v1",
}, },
"slight": { "slight": {
RuntimeType: "io.containerd.slight.v2", RuntimeType: "io.containerd.slight.v1",
BinaryName: "/tmp/testExecutables/containerd-shim-slight-v1", BinaryName: "/tmp/testExecutables/containerd-shim-slight-v1",
}, },
"spin": { "spin": {
RuntimeType: "io.containerd.spin.v2", RuntimeType: "io.containerd.spin.v2",
BinaryName: "/tmp/testExecutables/containerd-shim-spin-v1", BinaryName: "/tmp/testExecutables/containerd-shim-spin-v2",
}, },
"wws": { "wws": {
RuntimeType: "io.containerd.wws.v2", RuntimeType: "io.containerd.wws.v1",
BinaryName: "/tmp/testExecutables/containerd-shim-wws-v1", BinaryName: "/tmp/testExecutables/containerd-shim-wws-v1",
}, },
"wasmedge": { "wasmedge": {
RuntimeType: "io.containerd.wasmedge.v2", RuntimeType: "io.containerd.wasmedge.v1",
BinaryName: "/tmp/testExecutables/containerd-shim-wasmedge-v1", BinaryName: "/tmp/testExecutables/containerd-shim-wasmedge-v1",
}, },
"wasmer": { "wasmer": {
RuntimeType: "io.containerd.wasmer.v2", RuntimeType: "io.containerd.wasmer.v1",
BinaryName: "/tmp/testExecutables/containerd-shim-wasmer-v1", BinaryName: "/tmp/testExecutables/containerd-shim-wasmer-v1",
}, },
}, },