mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #97888 from pacoxu/fix/97565
check containerd as well as docker-containerd
This commit is contained in:
		@@ -71,9 +71,9 @@ import (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
	dockerProcessName = "dockerd"
 | 
						dockerProcessName = "dockerd"
 | 
				
			||||||
 | 
						// dockerd option --pidfile can specify path to use for daemon PID file, pid file path is default "/var/run/docker.pid"
 | 
				
			||||||
	dockerPidFile         = "/var/run/docker.pid"
 | 
						dockerPidFile         = "/var/run/docker.pid"
 | 
				
			||||||
	containerdProcessName = "docker-containerd"
 | 
						containerdProcessName = "containerd"
 | 
				
			||||||
	containerdPidFile     = "/run/docker/libcontainerd/docker-containerd.pid"
 | 
					 | 
				
			||||||
	maxPidFileLength      = 1 << 10 // 1KB
 | 
						maxPidFileLength      = 1 << 10 // 1KB
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -884,6 +884,8 @@ func EnsureDockerInContainer(dockerAPIVersion *utilversion.Version, oomScoreAdj
 | 
				
			|||||||
	type process struct{ name, file string }
 | 
						type process struct{ name, file string }
 | 
				
			||||||
	dockerProcs := []process{{dockerProcessName, dockerPidFile}}
 | 
						dockerProcs := []process{{dockerProcessName, dockerPidFile}}
 | 
				
			||||||
	if dockerAPIVersion.AtLeast(containerdAPIVersion) {
 | 
						if dockerAPIVersion.AtLeast(containerdAPIVersion) {
 | 
				
			||||||
 | 
							// By default containerd is started separately, so there is no pid file.
 | 
				
			||||||
 | 
							containerdPidFile := ""
 | 
				
			||||||
		dockerProcs = append(dockerProcs, process{containerdProcessName, containerdPidFile})
 | 
							dockerProcs = append(dockerProcs, process{containerdProcessName, containerdPidFile})
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	var errs []error
 | 
						var errs []error
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user