mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
Merge pull request #126588 from jingyuanliang/master
kubectl/describe: use function calls to build field selector
This commit is contained in:
commit
5302055b07
@ -3640,10 +3640,11 @@ func (d *NodeDescriber) Describe(namespace, name string, describerSettings Descr
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldSelector, err := fields.ParseSelector("spec.nodeName=" + name + ",status.phase!=" + string(corev1.PodSucceeded) + ",status.phase!=" + string(corev1.PodFailed))
|
fieldSelector := fields.AndSelectors(
|
||||||
if err != nil {
|
fields.OneTermEqualSelector("spec.nodeName", name),
|
||||||
return "", err
|
fields.OneTermNotEqualSelector("status.phase", string(corev1.PodSucceeded)),
|
||||||
}
|
fields.OneTermNotEqualSelector("status.phase", string(corev1.PodFailed)),
|
||||||
|
)
|
||||||
// in a policy aware setting, users may have access to a node, but not all pods
|
// in a policy aware setting, users may have access to a node, but not all pods
|
||||||
// in that case, we note that the user does not have access to the pods
|
// in that case, we note that the user does not have access to the pods
|
||||||
canViewPods := true
|
canViewPods := true
|
||||||
|
Loading…
Reference in New Issue
Block a user