mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Fake docker portfoward for in-process docker CRI integration
This commit is contained in:
@@ -1273,11 +1273,16 @@ func noPodInfraContainerError(podName, podNamespace string) error {
|
||||
// - should we support nsenter + socat on the host? (current impl)
|
||||
// - should we support nsenter + socat in a container, running with elevated privs and --pid=host?
|
||||
func (dm *DockerManager) PortForward(pod *kubecontainer.Pod, port uint16, stream io.ReadWriteCloser) error {
|
||||
return PortForward(dm.client, pod, port, stream)
|
||||
}
|
||||
|
||||
// Temporarily export this function to share with dockershim.
|
||||
func PortForward(client DockerInterface, pod *kubecontainer.Pod, port uint16, stream io.ReadWriteCloser) error {
|
||||
podInfraContainer := pod.FindContainerByName(PodInfraContainerName)
|
||||
if podInfraContainer == nil {
|
||||
return noPodInfraContainerError(pod.Name, pod.Namespace)
|
||||
}
|
||||
container, err := dm.client.InspectContainer(podInfraContainer.ID.ID)
|
||||
container, err := client.InspectContainer(podInfraContainer.ID.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user