From 79967816db761f17a81aedece4e9b75a7205a22c Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Tue, 12 Sep 2023 10:48:23 +0800 Subject: [PATCH] fix: No PodDisruptionBudget for single pod --- pkg/controller/pdb.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/controller/pdb.go b/pkg/controller/pdb.go index 074a3a7391d..cb8d480f22e 100644 --- a/pkg/controller/pdb.go +++ b/pkg/controller/pdb.go @@ -92,14 +92,14 @@ func (c *Controller) CreateOrUpdatePDB(ctx context.Context, t *v2.Tenant) (err e if existingStatefulSet.Status.ReadyReplicas != existingStatefulSet.Status.Replicas || existingStatefulSet.Status.Replicas == 0 { continue } + // No PodDisruptionBudget for single pod + if pool.Servers == 1 { + continue + } if t.Status.CurrentState != StatusInitialized { return nil } } - // No PodDisruptionBudget for single pod - if pool.Servers == 1 { - continue - } var pdbI client.Object if available.V1Available() { pdbI = &v1.PodDisruptionBudget{}