From 843d3e1caad51dba05c15eef3201e66b4fd0f52c Mon Sep 17 00:00:00 2001 From: Vasily Oleynikov Date: Fri, 17 May 2024 15:45:21 +0300 Subject: [PATCH] Fix logical backup job toleration (#2018) * Fix logical backup job toleration (now cluster and operator-wide instructions will be not ignored) --------- Co-authored-by: Felix Kunde --- pkg/cluster/k8sres.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/cluster/k8sres.go b/pkg/cluster/k8sres.go index ef8f21c1f..3b7d452b9 100644 --- a/pkg/cluster/k8sres.go +++ b/pkg/cluster/k8sres.go @@ -2242,6 +2242,8 @@ func (c *Cluster) generateLogicalBackupJob() (*batchv1.CronJob, error) { resourceRequirements *v1.ResourceRequirements ) + spec := &c.Spec + // NB: a cron job creates standard batch jobs according to schedule; these batch jobs manage pods and clean-up c.logger.Debug("Generating logical backup pod template") @@ -2291,6 +2293,8 @@ func (c *Cluster) generateLogicalBackupJob() (*batchv1.CronJob, error) { annotations := c.generatePodAnnotations(&c.Spec) + tolerationsSpec := tolerations(&spec.Tolerations, c.OpConfig.PodToleration) + // re-use the method that generates DB pod templates if podTemplate, err = c.generatePodTemplate( c.Namespace, @@ -2300,7 +2304,7 @@ func (c *Cluster) generateLogicalBackupJob() (*batchv1.CronJob, error) { []v1.Container{}, []v1.Container{}, util.False(), - &[]v1.Toleration{}, + &tolerationsSpec, nil, nil, nil,