Skip to content
Snippets Groups Projects
Commit 7c3c79ef authored by Marcin Wielgus's avatar Marcin Wielgus Committed by GitHub
Browse files

Merge pull request #101 from aleksandra-malinowska/pdb-check-fix

Add checking namespace to matching pods with PDBs
parents ee4de459 fd96489d
No related branches found
No related tags found
No related merge requests found
......@@ -93,7 +93,7 @@ func checkPdbs(pods []*apiv1.Pod, pdbs []*policyv1.PodDisruptionBudget) error {
return err
}
for _, pod := range pods {
if selector.Matches(labels.Set(pod.Labels)) {
if pod.Namespace == pdb.Namespace && selector.Matches(labels.Set(pod.Labels)) {
if pdb.Status.PodDisruptionsAllowed < 1 {
return fmt.Errorf("no enough pod disruption budget to move %s/%s", pod.Namespace, pod.Name)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment