Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use existing global var criSupportedLogDrivers #44126

Merged
merged 1 commit into from
May 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 6 additions & 13 deletions pkg/kubelet/dockershim/docker_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -234,19 +230,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")
}
}

Expand Down