From f1507dc2eb3bc22b7eb50a87fd02cfba346d4e20 Mon Sep 17 00:00:00 2001 From: "v.oleynikov" Date: Sat, 27 Aug 2022 07:55:19 +0300 Subject: [PATCH 1/2] Fix logical backup job toleration (now cluster and operator-wide instructions will be not ignored) --- 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 337cd3a63..e0a0ee965 100644 --- a/pkg/cluster/k8sres.go +++ b/pkg/cluster/k8sres.go @@ -2022,6 +2022,8 @@ func (c *Cluster) generateLogicalBackupJob() (*batchv1beta1.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") @@ -2066,6 +2068,8 @@ func (c *Cluster) generateLogicalBackupJob() (*batchv1beta1.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, @@ -2074,7 +2078,7 @@ func (c *Cluster) generateLogicalBackupJob() (*batchv1beta1.CronJob, error) { logicalBackupContainer, []v1.Container{}, []v1.Container{}, - &[]v1.Toleration{}, + &tolerationsSpec, nil, nil, nil, From 2173b5020db9718d8f202373b2f13c35068bfbf3 Mon Sep 17 00:00:00 2001 From: "v.oleynikov" Date: Sat, 27 Aug 2022 08:02:54 +0300 Subject: [PATCH 2/2] tab fix --- pkg/cluster/k8sres.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/k8sres.go b/pkg/cluster/k8sres.go index e0a0ee965..9ca259084 100644 --- a/pkg/cluster/k8sres.go +++ b/pkg/cluster/k8sres.go @@ -2022,7 +2022,7 @@ func (c *Cluster) generateLogicalBackupJob() (*batchv1beta1.CronJob, error) { resourceRequirements *v1.ResourceRequirements ) - spec := &c.Spec + spec := &c.Spec // NB: a cron job creates standard batch jobs according to schedule; these batch jobs manage pods and clean-up @@ -2068,7 +2068,7 @@ func (c *Cluster) generateLogicalBackupJob() (*batchv1beta1.CronJob, error) { annotations := c.generatePodAnnotations(&c.Spec) - tolerationsSpec := tolerations(&spec.Tolerations, c.OpConfig.PodToleration) + tolerationsSpec := tolerations(&spec.Tolerations, c.OpConfig.PodToleration) // re-use the method that generates DB pod templates if podTemplate, err = c.generatePodTemplate(