mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
Merge pull request #6985 from csrwng/fix_pod_log_location
Use Pod.Spec.Host instead of Pod.Status.HostIP for pod subresources
This commit is contained in:
commit
cf523a23d0
@ -200,7 +200,7 @@ func LogLocation(getter ResourceGetter, connInfo client.ConnectionInfoGetter, ct
|
||||
return nil, nil, errors.NewBadRequest(fmt.Sprintf("a container name must be specified for pod %s", name))
|
||||
}
|
||||
}
|
||||
nodeHost := pod.Status.HostIP
|
||||
nodeHost := pod.Spec.Host
|
||||
if len(nodeHost) == 0 {
|
||||
// If pod has not been assigned a host, return an empty location
|
||||
return nil, nil, nil
|
||||
@ -240,7 +240,7 @@ func ExecLocation(getter ResourceGetter, connInfo client.ConnectionInfoGetter, c
|
||||
return nil, nil, errors.NewBadRequest(fmt.Sprintf("a container name must be specified for pod %s", name))
|
||||
}
|
||||
}
|
||||
nodeHost := pod.Status.HostIP
|
||||
nodeHost := pod.Spec.Host
|
||||
if len(nodeHost) == 0 {
|
||||
// If pod has not been assigned a host, return an empty location
|
||||
return nil, nil, fmt.Errorf("pod %s does not have a host assigned", name)
|
||||
@ -280,7 +280,7 @@ func PortForwardLocation(getter ResourceGetter, connInfo client.ConnectionInfoGe
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
nodeHost := pod.Status.HostIP
|
||||
nodeHost := pod.Spec.Host
|
||||
if len(nodeHost) == 0 {
|
||||
// If pod has not been assigned a host, return an empty location
|
||||
return nil, nil, errors.NewBadRequest(fmt.Sprintf("pod %s does not have a host assigned", name))
|
||||
|
Loading…
Reference in New Issue
Block a user