Skip to content

Commit

Permalink
fix: modify the default container runtime to Docker (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhangSetSail authored Nov 24, 2022
1 parent 7071a4a commit adb8d8b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions util/containerutil/containerutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit adb8d8b

Please sign in to comment.