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 4605e5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions backend/src/utils/notebookUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ export const assembleNotebook = async (

const selectedImage = getImageTag(image, imageTagName);

imageUrl = `${selectedImage.image?.dockerImageRepo}:${selectedImage.tag?.name}`;
imageSelection = `${selectedImage.image?.name}:${selectedImage.tag?.name}`;
imageUrl = imageSelection;

Check failure on line 175 in backend/src/utils/notebookUtils.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

'imageUrl' is assigned a value but never used
} catch (e) {
fastify.log.error(`Error getting the image for ${imageName}:${imageTagName}`);
throw Error(
Expand Down Expand Up @@ -270,6 +270,7 @@ export const assembleNotebook = async (
'notebooks.opendatahub.io/oauth-logout-url': `${url}/notebookController/${translatedUsername}/home`,
'notebooks.opendatahub.io/last-size-selection': notebookSize.name,
'notebooks.opendatahub.io/last-image-selection': imageSelection,
'image.openshift.io/triggers': `[{"from":{"kind":"ImageStreamTag","name":"${imageSelection}", "namespace":"${namespace}"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"${name}\\")].image"}]`,
'opendatahub.io/username': username,
'kubeflow-resource-stopped': null,
'opendatahub.io/accelerator-name':
Expand All @@ -285,7 +286,7 @@ export const assembleNotebook = async (
enableServiceLinks: false,
containers: [
{
image: imageUrl,
image: imageSelection,
imagePullPolicy: 'Always',
workingDir: MOUNT_PATH,
name: name,
Expand All @@ -301,7 +302,7 @@ export const assembleNotebook = async (
},
{
name: 'JUPYTER_IMAGE',
value: imageUrl,
value: imageSelection,
},
...configMapEnvs,
...secretEnvs,
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/api/k8s/notebooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const assembleNotebook = (
existingResources,
} = data;
const notebookId = overrideNotebookId || translateDisplayNameForK8s(notebookName);
const imageUrl = `${image.imageStream?.status?.dockerImageRepository}:${image.imageVersion?.name}`;
const imageUrl = `${image.imageStream?.metadata.name}:${image.imageVersion?.name}`;
const imageSelection = `${image.imageStream?.metadata.name}:${image.imageVersion?.name}`;

const { affinity, tolerations, resources } = assemblePodSpecOptions(
Expand Down Expand Up @@ -107,6 +107,7 @@ export const assembleNotebook = (
'notebooks.opendatahub.io/last-image-selection': imageSelection,
'notebooks.opendatahub.io/inject-oauth': 'true',
'opendatahub.io/username': username,
'image.openshift.io/triggers': `[{"from":{"kind":"ImageStreamTag","name":"${imageSelection}", "namespace":"${projectName}"},"fieldPath":"spec.template.spec.containers[?(@.name==\\"${notebookId}\\")].image"}]`,
'opendatahub.io/accelerator-name':
acceleratorProfile.acceleratorProfile?.metadata.name || '',
},
Expand All @@ -120,7 +121,7 @@ export const assembleNotebook = (
enableServiceLinks: false,
containers: [
{
image: imageUrl,
image: imageSelection,
imagePullPolicy: 'Always',
workingDir: ROOT_MOUNT_PATH,
name: notebookId,
Expand All @@ -136,7 +137,7 @@ export const assembleNotebook = (
},
{
name: 'JUPYTER_IMAGE',
value: imageUrl,
value: imageSelection,
},
],
envFrom,
Expand Down

0 comments on commit 4605e5b

Please sign in to comment.