Commit 28dc2f74 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #38189 from feiskyer/fix-attach

Automatic merge from submit-queue (batch tested with PRs 36543, 38189, 38289, 38291, 36724) Kubelet: only check podUID when it is actually set Fixes #38188. cc/ @timstclair @yujuhong
parents f210c97e 1140d31d
...@@ -1357,7 +1357,7 @@ func (kl *Kubelet) GetAttach(podFullName string, podUID types.UID, containerName ...@@ -1357,7 +1357,7 @@ func (kl *Kubelet) GetAttach(podFullName string, podUID types.UID, containerName
// since whether the process is running in a TTY cannot be changed after it has started. We // since whether the process is running in a TTY cannot be changed after it has started. We
// need the api.Pod to get the TTY status. // need the api.Pod to get the TTY status.
pod, found := kl.GetPodByFullName(podFullName) pod, found := kl.GetPodByFullName(podFullName)
if !found || pod.UID != podUID { if !found || (string(podUID) != "" && pod.UID != podUID) {
return nil, fmt.Errorf("pod %s not found", podFullName) return nil, fmt.Errorf("pod %s not found", podFullName)
} }
containerSpec := kubecontainer.GetContainerSpec(pod, containerName) containerSpec := kubecontainer.GetContainerSpec(pod, containerName)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment