Skip to content

Commit

Permalink
Change imagageurl to be equal with imageselection
Browse files Browse the repository at this point in the history
  • Loading branch information
atheo89 committed May 9, 2024
1 parent 62b5097 commit dd59b96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions backend/src/utils/notebookUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,13 @@ export const assembleNotebook = async (

const notebookSize = getNotebookSize(notebookSizeName);

let imageUrl = ``;
let imageSelection = ``;

try {
const image = await getImageInfo(fastify, imageName);

const selectedImage = getImageTag(image, imageTagName);

imageUrl = `${selectedImage.image?.dockerImageRepo}:${selectedImage.tag?.name}`;
imageSelection = `${selectedImage.image?.name}:${selectedImage.tag?.name}`;
} catch (e) {
fastify.log.error(`Error getting the image for ${imageName}:${imageTagName}`);
Expand Down Expand Up @@ -285,7 +283,7 @@ export const assembleNotebook = async (
enableServiceLinks: false,
containers: [
{
image: imageUrl,
image: imageSelection,
imagePullPolicy: 'Always',
workingDir: MOUNT_PATH,
name: name,
Expand All @@ -301,7 +299,7 @@ export const assembleNotebook = async (
},
{
name: 'JUPYTER_IMAGE',
value: imageUrl,
value: imageSelection,
},
...configMapEnvs,
...secretEnvs,
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/api/k8s/notebooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const assembleNotebook = (
existingResources,
} = data;
const notebookId = overrideNotebookId || translateDisplayNameForK8s(notebookName);
const imageUrl = `${image.imageStream?.status?.dockerImageRepository}:${image.imageVersion?.name}`;
const imageSelection = `${image.imageStream?.metadata.name}:${image.imageVersion?.name}`;

const { affinity, tolerations, resources } = assemblePodSpecOptions(
Expand Down Expand Up @@ -120,7 +119,7 @@ export const assembleNotebook = (
enableServiceLinks: false,
containers: [
{
image: imageUrl,
image: imageSelection,
imagePullPolicy: 'Always',
workingDir: ROOT_MOUNT_PATH,
name: notebookId,
Expand All @@ -136,7 +135,7 @@ export const assembleNotebook = (
},
{
name: 'JUPYTER_IMAGE',
value: imageUrl,
value: imageSelection,
},
],
envFrom,
Expand Down

0 comments on commit dd59b96

Please sign in to comment.