@@ -464,9 +464,9 @@ func (c *StashController) ensureBackupJob(inv invoker.BackupInvoker, targetInfo
464
464
// set BackupSession as owner of this Job so that it get cleaned automatically
465
465
// when the BackupSession gets deleted according to backupHistoryLimit
466
466
core_util .EnsureOwnerReference (& in .ObjectMeta , ownerBackupSession )
467
- // pass offshoot labels to job's pod
468
- in .Spec .Template .Labels = meta_util .OverwriteKeys (in .Spec .Template .Labels , inv .GetLabels ())
467
+
469
468
in .Spec .Template .Spec = podSpec
469
+ in .Spec .Template .Labels = meta_util .OverwriteKeys (in .Spec .Template .Labels , inv .GetLabels ())
470
470
in .Spec .Template .Spec .ImagePullSecrets = core_util .MergeLocalObjectReferences (in .Spec .Template .Spec .ImagePullSecrets , imagePullSecrets )
471
471
in .Spec .Template .Spec .ServiceAccountName = rbacOptions .ServiceAccount .Name
472
472
in .Spec .BackoffLimit = pointer .Int32P (0 )
@@ -543,9 +543,7 @@ func (c *StashController) ensureVolumeSnapshotterJob(inv invoker.BackupInvoker,
543
543
// when the BackupSession gets deleted according to backupHistoryLimit
544
544
core_util .EnsureOwnerReference (& in .ObjectMeta , ownerBackupSession )
545
545
546
- in .Labels = inv .GetLabels ()
547
- in .Spec .Template = * jobTemplate
548
- // pass offshoot labels to job's pod
546
+ in .Spec .Template .Spec = jobTemplate .Spec
549
547
in .Spec .Template .Labels = meta_util .OverwriteKeys (in .Spec .Template .Labels , inv .GetLabels ())
550
548
in .Spec .Template .Spec .ImagePullSecrets = core_util .MergeLocalObjectReferences (in .Spec .Template .Spec .ImagePullSecrets , imagePullSecrets )
551
549
in .Spec .Template .Spec .ServiceAccountName = rbacOptions .ServiceAccount .Name
0 commit comments