From adb8d8bb82fa0833f0fdc54af57e5f069f47a0e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=AF=E8=88=AA?= <101104760+ZhangSetSail@users.noreply.github.com> Date: Thu, 24 Nov 2022 21:15:19 +0800 Subject: [PATCH] fix: modify the default container runtime to Docker (#175) --- util/containerutil/containerutil.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/util/containerutil/containerutil.go b/util/containerutil/containerutil.go index b378f7f7..08dae942 100644 --- a/util/containerutil/containerutil.go +++ b/util/containerutil/containerutil.go @@ -12,16 +12,16 @@ const ( // GetContainerRuntime get container runtime func GetContainerRuntime() string { if os.Getenv("CONTAINER_RUNTIME") != "" { - if os.Getenv("CONTAINER_RUNTIME") == ContainerRuntimeDocker { - return ContainerRuntimeDocker + if os.Getenv("CONTAINER_RUNTIME") == ContainerRuntimeContainerd { + return ContainerRuntimeContainerd } - return ContainerRuntimeContainerd + return ContainerRuntimeDocker } // The containerd runtime is used by default - _, err := os.Stat("/run/containerd/containerd.sock") + _, err := os.Stat("/var/run/docker.sock") if err != nil { // no such file or dir, Indicates that the user does not have containerd installed and uses docker as the runtime - return ContainerRuntimeDocker + return ContainerRuntimeContainerd } - return ContainerRuntimeContainerd + return ContainerRuntimeDocker }