From 0161e852459241a5e18bce7122cac4da67cfb5fd Mon Sep 17 00:00:00 2001 From: David van der Spek Date: Tue, 16 May 2023 11:37:21 +0200 Subject: [PATCH] fix: make pdb target all pods in the cluster Signed-off-by: David van der Spek --- pkg/cluster/k8sres.go | 2 +- pkg/cluster/k8sres_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/cluster/k8sres.go b/pkg/cluster/k8sres.go index c0e99f93f..3ee744c75 100644 --- a/pkg/cluster/k8sres.go +++ b/pkg/cluster/k8sres.go @@ -2144,7 +2144,7 @@ func (c *Cluster) generatePodDisruptionBudget() *policyv1.PodDisruptionBudget { Spec: policyv1.PodDisruptionBudgetSpec{ MinAvailable: &minAvailable, Selector: &metav1.LabelSelector{ - MatchLabels: c.roleLabelsSet(false, Master), + MatchLabels: c.labelsSet(false), }, }, } diff --git a/pkg/cluster/k8sres_test.go b/pkg/cluster/k8sres_test.go index a88320deb..472c11022 100644 --- a/pkg/cluster/k8sres_test.go +++ b/pkg/cluster/k8sres_test.go @@ -2224,7 +2224,7 @@ func TestGeneratePodDisruptionBudget(t *testing.T) { Spec: policyv1.PodDisruptionBudgetSpec{ MinAvailable: util.ToIntStr(1), Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{"spilo-role": "master", "cluster-name": "myapp-database"}, + MatchLabels: map[string]string{"cluster-name": "myapp-database"}, }, }, }, @@ -2248,7 +2248,7 @@ func TestGeneratePodDisruptionBudget(t *testing.T) { Spec: policyv1.PodDisruptionBudgetSpec{ MinAvailable: util.ToIntStr(0), Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{"spilo-role": "master", "cluster-name": "myapp-database"}, + MatchLabels: map[string]string{"cluster-name": "myapp-database"}, }, }, }, @@ -2272,7 +2272,7 @@ func TestGeneratePodDisruptionBudget(t *testing.T) { Spec: policyv1.PodDisruptionBudgetSpec{ MinAvailable: util.ToIntStr(0), Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{"spilo-role": "master", "cluster-name": "myapp-database"}, + MatchLabels: map[string]string{"cluster-name": "myapp-database"}, }, }, }, @@ -2296,7 +2296,7 @@ func TestGeneratePodDisruptionBudget(t *testing.T) { Spec: policyv1.PodDisruptionBudgetSpec{ MinAvailable: util.ToIntStr(1), Selector: &metav1.LabelSelector{ - MatchLabels: map[string]string{"spilo-role": "master", "cluster-name": "myapp-database"}, + MatchLabels: map[string]string{"cluster-name": "myapp-database"}, }, }, },