feat: support snapshot recovery job

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
This commit is contained in:
Marco Nenciarini 2025-04-15 08:51:52 +02:00 committed by Leonardo Cecchi
parent c32ddf1a0c
commit 725a90e0d9

View File

@ -153,7 +153,9 @@ func reconcileJob(
WithValues("jobName", job.Name) WithValues("jobName", job.Name)
contextLogger.Debug("starting job reconciliation") contextLogger.Debug("starting job reconciliation")
if getCNPGJobRole(&job) != "full-recovery" { jobRole := getCNPGJobRole(&job)
if jobRole != "full-recovery" &&
jobRole != "snapshot-recovery" {
contextLogger.Debug("job is not a recovery job, skipping") contextLogger.Debug("job is not a recovery job, skipping")
return nil, nil return nil, nil
} }
@ -163,7 +165,7 @@ func reconcileJob(
if err := reconcilePodSpec( if err := reconcilePodSpec(
cluster, cluster,
&mutatedJob.Spec.Template.Spec, &mutatedJob.Spec.Template.Spec,
"full-recovery", jobRole,
corev1.Container{ corev1.Container{
Args: []string{"restore"}, Args: []string{"restore"},
}, },