From 3b2836e863850a6348e772e897d6cc0b76d70964 Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Tue, 12 Sep 2023 10:43:26 +0800 Subject: [PATCH] fix: No PodDisruptionBudget for single pod --- pkg/controller/pdb.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/controller/pdb.go b/pkg/controller/pdb.go index 4c97a49eea1..f5e3c26f7f0 100644 --- a/pkg/controller/pdb.go +++ b/pkg/controller/pdb.go @@ -96,6 +96,10 @@ func (c *Controller) CreateOrUpdatePDB(ctx context.Context, t *v2.Tenant) (err e return nil } } + // No PodDisruptionBudget for single pod + if pool.Servers == 1 { + return nil + } var pdbI client.Object if available.V1Available() { pdbI = &v1.PodDisruptionBudget{}