mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-31 18:28:13 +00:00 
			
		
		
		
	Merge pull request #44126 from xiangpengzhao/fix-const
Automatic merge from submit-queue (batch tested with PRs 45508, 44258, 44126, 45441, 45320) Use existing global var criSupportedLogDrivers **What this PR does / why we need it**: Use existing global var `criSupportedLogDrivers` defined in docker_service.go. If CRI supports other log drivers in the future, we will only need to modify that global var. cc @Random-Liu
This commit is contained in:
		| @@ -32,10 +32,6 @@ import ( | ||||
| 	"k8s.io/kubernetes/pkg/kubelet/dockertools" | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	dockerDefaultLoggingDriver = "json-file" | ||||
| ) | ||||
|  | ||||
| // ListContainers lists all containers matching the filter. | ||||
| func (ds *dockerService) ListContainers(filter *runtimeapi.ContainerFilter) ([]*runtimeapi.Container, error) { | ||||
| 	opts := dockertypes.ContainerListOptions{All: true} | ||||
| @@ -236,19 +232,16 @@ func (ds *dockerService) createContainerLogSymlink(containerID string) error { | ||||
| 				path, realPath, containerID, err) | ||||
| 		} | ||||
| 	} else { | ||||
| 		dockerLoggingDriver := "" | ||||
| 		dockerInfo, err := ds.client.Info() | ||||
| 		supported, err := IsCRISupportedLogDriver(ds.client) | ||||
| 		if err != nil { | ||||
| 			glog.Errorf("Failed to execute Info() call to the Docker client: %v", err) | ||||
| 		} else { | ||||
| 			dockerLoggingDriver = dockerInfo.LoggingDriver | ||||
| 			glog.V(10).Infof("Docker logging driver is %s", dockerLoggingDriver) | ||||
| 			glog.Warningf("Failed to check supported logging driver by CRI: %v", err) | ||||
| 			return nil | ||||
| 		} | ||||
|  | ||||
| 		if dockerLoggingDriver == dockerDefaultLoggingDriver { | ||||
| 			glog.Errorf("Cannot create symbolic link because container log file doesn't exist!") | ||||
| 		if supported { | ||||
| 			glog.Warningf("Cannot create symbolic link because container log file doesn't exist!") | ||||
| 		} else { | ||||
| 			glog.V(5).Infof("Unsupported logging driver: %s", dockerLoggingDriver) | ||||
| 			glog.V(5).Infof("Unsupported logging driver by CRI") | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Kubernetes Submit Queue
					Kubernetes Submit Queue