From c23e283ac2e3d362258efef5ddca43c71c983add Mon Sep 17 00:00:00 2001 From: sivakumar subraani Date: Mon, 11 Dec 2023 13:13:12 +0000 Subject: [PATCH] pb-4943: Added fix to return proper error message, if the kdmp backup fails in DataExportStageTransferInProgress stage. - Currently, we are passing empty reason for the failed case, so the reason is not passed to the UI. In the failed case, it shows empty reason. --- pkg/controllers/dataexport/reconcile.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/controllers/dataexport/reconcile.go b/pkg/controllers/dataexport/reconcile.go index fe779fc28..c32c22bd2 100644 --- a/pkg/controllers/dataexport/reconcile.go +++ b/pkg/controllers/dataexport/reconcile.go @@ -376,13 +376,19 @@ func (c *Controller) sync(ctx context.Context, in *kdmpapi.DataExport) (bool, er } return true, c.updateStatus(dataExport, data) case kdmpapi.DataExportStageTransferInProgress: + var reason string + if dataExport.Status.Status == kdmpapi.DataExportStatusSuccessful { + reason = "" + } else { + reason = dataExport.Status.Reason + } if dataExport.Status.Status == kdmpapi.DataExportStatusSuccessful || dataExport.Status.Status == kdmpapi.DataExportStatusFailed { // set to the next stage data := updateDataExportDetail{ stage: kdmpapi.DataExportStageCleanup, status: dataExport.Status.Status, - reason: "", + reason: reason, } return false, c.updateStatus(dataExport, data) }