From 9ab3c134c8bc977be74ee6ece9c7536e635c8f3d Mon Sep 17 00:00:00 2001 From: ppadti Date: Mon, 15 Jul 2024 17:17:24 +0530 Subject: [PATCH] Restart the pod after updating configMap in workbench --- .../pages/projects/screens/spawner/SpawnerFooter.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/projects/screens/spawner/SpawnerFooter.tsx b/frontend/src/pages/projects/screens/spawner/SpawnerFooter.tsx index dc8b9575ec..e62dd762a3 100644 --- a/frontend/src/pages/projects/screens/spawner/SpawnerFooter.tsx +++ b/frontend/src/pages/projects/screens/spawner/SpawnerFooter.tsx @@ -173,6 +173,11 @@ const SpawnerFooter: React.FC = ({ return; } + const annotations = { ...editNotebook.metadata.annotations }; + if (envFrom.length > 0) { + annotations['notebooks.opendatahub.io/notebook-restart'] = 'true'; + } + const { volumes, volumeMounts } = pvcDetails; const newStartNotebookData = { ...startNotebookData, @@ -181,7 +186,12 @@ const SpawnerFooter: React.FC = ({ envFrom, tolerationSettings, }; - return updateNotebook(editNotebook, newStartNotebookData, username, { dryRun }); + return updateNotebook( + { ...editNotebook, metadata: { ...editNotebook.metadata, annotations } }, + newStartNotebookData, + username, + { dryRun }, + ); }; updateNotebookPromise(true)