Reuse configured TopologySpreadConstraints for logical backup.

This commit is contained in:
Trung Minh Lai 2025-03-08 13:10:22 +07:00 committed by laiminhtrung1997
parent 077b50b797
commit 2bd1559b9c
1 changed files with 3 additions and 1 deletions

View File

@ -2359,6 +2359,8 @@ func (c *Cluster) generateLogicalBackupJob() (*batchv1.CronJob, error) {
tolerationsSpec := tolerations(&spec.Tolerations, c.OpConfig.PodToleration)
topologySpreadConstraintsSpec := generateTopologySpreadConstraints(labels, spec.TopologySpreadConstraints)
// re-use the method that generates DB pod templates
if podTemplate, err = c.generatePodTemplate(
c.Namespace,
@ -2368,7 +2370,7 @@ func (c *Cluster) generateLogicalBackupJob() (*batchv1.CronJob, error) {
[]v1.Container{},
[]v1.Container{},
util.False(),
[]v1.TopologySpreadConstraint{},
topologySpreadConstraintsSpec,
&tolerationsSpec,
c.nodeAffinity(c.OpConfig.NodeReadinessLabel, nil),
nil,