From 8a0f3895c40c38235aafe692ee88715cadeddfa6 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 c49ecb980..1d93b07cb 100644 --- a/pkg/cluster/k8sres.go +++ b/pkg/cluster/k8sres.go @@ -885,9 +885,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)