From 0518b6d930fa5095b5568b9a1656cab04dc41fb8 Mon Sep 17 00:00:00 2001 From: Trung Minh Lai Date: Sat, 18 Oct 2025 22:36:36 +0700 Subject: [PATCH] Remove unnecessary len check. --- pkg/cluster/k8sres.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/cluster/k8sres.go b/pkg/cluster/k8sres.go index 482efa41c..cc4873ce5 100644 --- a/pkg/cluster/k8sres.go +++ b/pkg/cluster/k8sres.go @@ -894,9 +894,7 @@ func (c *Cluster) generatePodTemplate( podSpec.PriorityClassName = priorityClassName } - if len(topologySpreadConstraintsSpec) > 0 { - podSpec.TopologySpreadConstraints = generateTopologySpreadConstraints(labels, topologySpreadConstraintsSpec) - } + podSpec.TopologySpreadConstraints = generateTopologySpreadConstraints(labels, topologySpreadConstraintsSpec) if sharePgSocketWithSidecars != nil && *sharePgSocketWithSidecars { addVarRunVolume(&podSpec)