Skip to content

Commit a828316

Browse files
author
Joshua Sierles
committed
add sidecars to the restore job as well
1 parent b287164 commit a828316

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/controller/postgrescluster/pgbackrest.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,6 +1391,14 @@ func (r *Reconciler) generateRestoreJobIntent(cluster *v1beta1.PostgresCluster,
13911391
}
13921392
}
13931393

1394+
// Add sidecars from RepoHost.Containers to the restore job
1395+
if cluster.Spec.Backups.PGBackRest.RepoHost != nil &&
1396+
cluster.Spec.Backups.PGBackRest.RepoHost.Containers != nil {
1397+
job.Spec.Template.Spec.Containers = append(
1398+
job.Spec.Template.Spec.Containers,
1399+
cluster.Spec.Backups.PGBackRest.RepoHost.Containers...)
1400+
}
1401+
13941402
// Set the image pull secrets, if any exist.
13951403
// This is set here rather than using the service account due to the lack
13961404
// of propagation to existing pods when the CRD is updated:

0 commit comments

Comments
 (0)