Skip to content

Commit e00024f

Browse files
authored
feat: support snapshot recovery job (#258)
Signed-off-by: Marco Nenciarini <[email protected]>
1 parent c32ddf1 commit e00024f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/cnpgi/operator/lifecycle.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ func reconcileJob(
153153
WithValues("jobName", job.Name)
154154
contextLogger.Debug("starting job reconciliation")
155155

156-
if getCNPGJobRole(&job) != "full-recovery" {
156+
jobRole := getCNPGJobRole(&job)
157+
if jobRole != "full-recovery" &&
158+
jobRole != "snapshot-recovery" {
157159
contextLogger.Debug("job is not a recovery job, skipping")
158160
return nil, nil
159161
}
@@ -163,7 +165,7 @@ func reconcileJob(
163165
if err := reconcilePodSpec(
164166
cluster,
165167
&mutatedJob.Spec.Template.Spec,
166-
"full-recovery",
168+
jobRole,
167169
corev1.Container{
168170
Args: []string{"restore"},
169171
},

0 commit comments

Comments
 (0)