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 <felix-kunde@gmx.de>
This commit is contained in:
Vasily Oleynikov
2024-05-17 14:45:21 +02:00
committed by GitHub
co-authored by Felix Kunde
parent 13d6594cdf
commit 843d3e1caa
+5 -1
View File
@@ -2242,6 +2242,8 @@ func (c *Cluster) generateLogicalBackupJob() (*batchv1.CronJob, error) {
resourceRequirements *v1.ResourceRequirements 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 // 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") c.logger.Debug("Generating logical backup pod template")
@@ -2291,6 +2293,8 @@ func (c *Cluster) generateLogicalBackupJob() (*batchv1.CronJob, error) {
annotations := c.generatePodAnnotations(&c.Spec) annotations := c.generatePodAnnotations(&c.Spec)
tolerationsSpec := tolerations(&spec.Tolerations, c.OpConfig.PodToleration)
// re-use the method that generates DB pod templates // re-use the method that generates DB pod templates
if podTemplate, err = c.generatePodTemplate( if podTemplate, err = c.generatePodTemplate(
c.Namespace, c.Namespace,
@@ -2300,7 +2304,7 @@ func (c *Cluster) generateLogicalBackupJob() (*batchv1.CronJob, error) {
[]v1.Container{}, []v1.Container{},
[]v1.Container{}, []v1.Container{},
util.False(), util.False(),
&[]v1.Toleration{}, &tolerationsSpec,
nil, nil,
nil, nil,
nil, nil,