@@ -399,7 +399,7 @@ func (c *StashController) ensureRestoreJob(inv invoker.RestoreInvoker, index int
399
399
runtimeSettings := targetInfo .RuntimeSettings
400
400
// pass offshoot labels to job's pod
401
401
jobTemplate .Labels = meta_util .OverwriteKeys (jobTemplate .Labels , inv .GetLabels ())
402
- jobTemplate .Spec .ImagePullSecrets = imagePullSecrets
402
+ jobTemplate .Spec .ImagePullSecrets = core_util . MergeLocalObjectReferences ( jobTemplate . Spec . ImagePullSecrets , imagePullSecrets )
403
403
jobTemplate .Spec .ServiceAccountName = rbacOptions .ServiceAccount .Name
404
404
if runtimeSettings .Pod != nil && runtimeSettings .Pod .PodAnnotations != nil {
405
405
jobTemplate .Annotations = runtimeSettings .Pod .PodAnnotations
@@ -467,7 +467,7 @@ func (c *StashController) ensureRestoreJob(inv invoker.RestoreInvoker, index int
467
467
restoreJobTemplate .Spec .Containers [i ].Env = core_util .UpsertEnvVars (c .Env , ordinalEnv )
468
468
}
469
469
470
- restoreJobTemplate .Spec .ImagePullSecrets = imagePullSecrets
470
+ restoreJobTemplate .Spec .ImagePullSecrets = core_util . MergeLocalObjectReferences ( restoreJobTemplate . Spec . ImagePullSecrets , imagePullSecrets )
471
471
restoreJobTemplate .Spec .ServiceAccountName = rbacOptions .ServiceAccount .Name
472
472
473
473
// create restore job
@@ -647,7 +647,7 @@ func (c *StashController) ensureVolumeRestorerJob(inv invoker.RestoreInvoker, in
647
647
// pass offshoot labels to job's pod
648
648
in .Spec .Template .Labels = meta_util .OverwriteKeys (in .Spec .Template .Labels , inv .GetLabels ())
649
649
in .Spec .Template = * jobTemplate
650
- in .Spec .Template .Spec .ImagePullSecrets = imagePullSecrets
650
+ in .Spec .Template .Spec .ImagePullSecrets = core_util . MergeLocalObjectReferences ( in . Spec . Template . Spec . ImagePullSecrets , imagePullSecrets )
651
651
in .Spec .Template .Spec .ServiceAccountName = serviceAccountName
652
652
in .Spec .BackoffLimit = pointer .Int32P (0 )
653
653
return in
0 commit comments