1/* 2Copyright 2020 The Kubernetes Authors. 3 4Licensed under the Apache License, Version 2.0 (the "License"); 5you may not use this file except in compliance with the License. 6You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10Unless required by applicable law or agreed to in writing, software 11distributed under the License is distributed on an "AS IS" BASIS, 12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13See the License for the specific language governing permissions and 14limitations under the License. 15*/ 16 17package legacy 18 19import ( 20 "context" 21 "io" 22 23 "k8s.io/api/core/v1" 24 kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" 25 "k8s.io/kubernetes/pkg/kubelet/kuberuntime" 26) 27 28// DockerLegacyService interface is used throughout `pkg/kubelet`. 29// It used to live in the `pkg/kubelet/dockershim` package. While we 30// would eventually like to remove it entirely, we need to give users some form 31// of warning. 32// 33// By including the interface in 34// `pkg/kubelet/legacy/logs.go`, we ensure the interface is 35// available to `pkg/kubelet`, even when we are building with the `dockerless` 36// tag (i.e. not compiling the dockershim). 37// While the interface always exists, there will be no implementations of the 38// interface when building with the `dockerless` tag. The lack of 39// implementations should not be an issue, as we only expect `pkg/kubelet` code 40// to need an implementation of the `DockerLegacyService` when we are using 41// docker. If we are using docker, but building with the `dockerless` tag, than 42// this will be just one of many things that breaks. 43type DockerLegacyService interface { 44 // GetContainerLogs gets logs for a specific container. 45 GetContainerLogs(context.Context, *v1.Pod, kubecontainer.ContainerID, *v1.PodLogOptions, io.Writer, io.Writer) error 46 47 // IsCRISupportedLogDriver checks whether the logging driver used by docker is 48 // supported by native CRI integration. 49 // TODO(resouer): remove this when deprecating unsupported log driver 50 IsCRISupportedLogDriver() (bool, error) 51 52 kuberuntime.LegacyLogProvider 53} 54