mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-07 18:06:21 +00:00
Merge pull request #107559 from liggitt/invalid-selectors
Handle invalid selectors properly
This commit is contained in:
@@ -277,6 +277,7 @@ func filterPodsWithPDBViolation(podInfos []*framework.PodInfo, pdbs []*policy.Po
|
||||
}
|
||||
selector, err := metav1.LabelSelectorAsSelector(pdb.Spec.Selector)
|
||||
if err != nil {
|
||||
// This object has an invalid selector, it does not match the pod
|
||||
continue
|
||||
}
|
||||
// A PDB with a nil or empty selector matches nothing.
|
||||
|
||||
@@ -990,7 +990,6 @@ func (b *volumeBinder) nodeHasAccess(node *v1.Node, capacity *storagev1beta1.CSI
|
||||
// Only matching by label is supported.
|
||||
selector, err := metav1.LabelSelectorAsSelector(capacity.NodeTopology)
|
||||
if err != nil {
|
||||
// This should never happen because NodeTopology must be valid.
|
||||
klog.ErrorS(err, "Unexpected error converting to a label selector", "nodeTopology", capacity.NodeTopology)
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user