Skip to content

Commit

Permalink
Merge pull request #9864 from rottencandy/fix/export-start
Browse files Browse the repository at this point in the history
Bug 1997135: Start new export if export CR is not found
  • Loading branch information
openshift-merge-robot committed Aug 26, 2021
2 parents 039e6c4 + 7be166e commit 81b5f97
Showing 1 changed file with 7 additions and 6 deletions.
Expand Up @@ -85,24 +85,25 @@ const ExportApplication: React.FC<ExportApplicationProps> = ({ namespace, isDisa
};

const exportAppClickHandle = async () => {
if (isCreating) {
exportApplicationModal({ namespace });
return;
}
try {
setIsCreating(true);
const exportRes = await k8sGet(ExportModel, EXPORT_CR_NAME, namespace);
if (exportRes && exportRes.status?.completed !== true) {
const startTime = dateTimeFormatter.format(new Date(exportRes.metadata.creationTimestamp));
exportApplicationModal({ namespace, startTime });
setIsCreating(false);
} else if (exportRes && exportRes.status?.completed) {
await k8sKill(ExportModel, exportRes);
const exportAppToastConfig = _.omit(exportAppToast, `${namespace}-${EXPORT_CR_NAME}`);
setExportAppToast(exportAppToastConfig);
createExportCR();
await createExportCR();
}
} catch {
if (isCreating) {
exportApplicationModal({ namespace });
return;
}
createExportCR();
await createExportCR();
}
};

Expand Down

0 comments on commit 81b5f97

Please sign in to comment.