From 0af2fd4ba4c4ca4c20058a43097cca2e3d2fb1f8 Mon Sep 17 00:00:00 2001 From: FlikweertvisionVadym <167079316+FlikweertvisionVadym@users.noreply.github.com> Date: Mon, 27 Jan 2025 14:26:57 +0100 Subject: [PATCH 1/2] Fix: issue cri-dockerd runtime not being found Signed-off-by: Vadym Tartakovskyi Signed-off-by: Vadym Tartakovskyi --- pkg/daemon/criruntime/factory.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/daemon/criruntime/factory.go b/pkg/daemon/criruntime/factory.go index 35daff2750..a469c832e7 100644 --- a/pkg/daemon/criruntime/factory.go +++ b/pkg/daemon/criruntime/factory.go @@ -208,6 +208,12 @@ func detectRuntime(varRunPath string) (cfgs []runtimeConfig) { runtimeRemoteURI: fmt.Sprintf("unix://%s/cri-dockerd.sock", varRunPath), }) } + if _, err = os.Stat(fmt.Sprintf("%s/cri-dockerd/cri-dockerd.sock", varRunPath)); err == nil { + cfgs = append(cfgs, runtimeConfig{ + runtimeType: ContainerRuntimeCommonCRI, + runtimeRemoteURI: fmt.Sprintf("unix://%s/cri-dockerd/cri-dockerd.sock", varRunPath), + }) + } } return cfgs } From 739d50bbabcd99c14c026f167c5ac47423edd0de Mon Sep 17 00:00:00 2001 From: FlikweertvisionVadym <167079316+FlikweertvisionVadym@users.noreply.github.com> Date: Wed, 29 Jan 2025 09:10:20 +0100 Subject: [PATCH 2/2] Update factory.go Signed-off-by: Vadym Tartakovskyi Signed-off-by: Vadym Tartakovskyi --- pkg/daemon/criruntime/factory.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/daemon/criruntime/factory.go b/pkg/daemon/criruntime/factory.go index a469c832e7..ff6fffcc06 100644 --- a/pkg/daemon/criruntime/factory.go +++ b/pkg/daemon/criruntime/factory.go @@ -208,6 +208,8 @@ func detectRuntime(varRunPath string) (cfgs []runtimeConfig) { runtimeRemoteURI: fmt.Sprintf("unix://%s/cri-dockerd.sock", varRunPath), }) } + // Check if the cri-dockerd runtime socket exists in the expected k3s runtime directory. + // If found, append it to the runtime configuration list to ensure k3s can use cri-dockerd. if _, err = os.Stat(fmt.Sprintf("%s/cri-dockerd/cri-dockerd.sock", varRunPath)); err == nil { cfgs = append(cfgs, runtimeConfig{ runtimeType: ContainerRuntimeCommonCRI,