Skip to content

Commit

Permalink
[release-v1.56] Fix DataImportCron PVC update error check (#2795)
Browse files Browse the repository at this point in the history
Fixed in #2696 in main/release-v1.57 as part of the linter error fixes.

PVC lastUseTime annotation was sometimes not updated so DataImportCron
PVC garbage collection was misbehaving and deleting the latest imported
PVC, which was then re-imported again until the update succeeded.

The issue was introduced by #2539 and found due to flaky [test_id:7406].

bz #2221913

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
  • Loading branch information
arnongilboa authored Jul 12, 2023
1 parent bd434ec commit 054a272
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/dataimportcron-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func (r *DataImportCronReconciler) update(ctx context.Context, dataImportCron *c
if dv != nil {
switch dv.Status.Phase {
case cdiv1.Succeeded:
if r.updatePvc(ctx, dataImportCron, pvc); err != nil {
if err = r.updatePvc(ctx, dataImportCron, pvc); err != nil {
return res, err
}
importSucceeded = true
Expand All @@ -322,7 +322,7 @@ func (r *DataImportCronReconciler) update(ctx context.Context, dataImportCron *c
updateDataImportCronCondition(dataImportCron, cdiv1.DataImportCronProgressing, corev1.ConditionFalse, fmt.Sprintf("Import DataVolume phase %s", dvPhase), dvPhase)
}
} else if pvc != nil {
if r.updatePvc(ctx, dataImportCron, pvc); err != nil {
if err = r.updatePvc(ctx, dataImportCron, pvc); err != nil {
return res, err
}
importSucceeded = true
Expand Down

0 comments on commit 054a272

Please sign in to comment.