Skip to content

Commit

Permalink
fix(byon): Use notebook-image label for visibility toggle (#169)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Coufal <[email protected]>
  • Loading branch information
tumido authored Apr 6, 2022
1 parent 3427e7a commit 8b060f9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions backend/src/routes/api/notebook/notebooksUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const mapImageStreamToNotebook = (is: ImageStreamKind): Notebook => ({
name: is.metadata.annotations["opendatahub.io/notebook-image-name"],
description: is.metadata.annotations["opendatahub.io/notebook-image-name"],
phase: is.metadata.annotations["opendatahub.io/notebook-image-phase"] as NotebookStatus,
visible: is.metadata.annotations["opendatahub.io/notebook-image-visible"] === "true",
visible: is.metadata.labels["opendatahub.io/notebook-image"] === "true",
error: Boolean(is.metadata.annotations["opendatahub.io/notebook-image-messages"])
? JSON.parse(is.metadata.annotations["opendatahub.io/notebook-image-messages"])
: [],
Expand Down Expand Up @@ -222,7 +222,11 @@ export const updateNotebook = async (
imageStream.spec.tags[0].annotations["opendatahub.io/notebook-software"] = JSON.stringify(body.software)
}
if (typeof body.visible !== "undefined") {
imageStream.metadata.annotations["opendatahub.io/notebook-image-visible"] = body.visible.toString()
if (body.visible) {
imageStream.metadata.labels["opendatahub.io/notebook-image"] = "true"
} else {
imageStream.metadata.labels["opendatahub.io/notebook-image"] = null
}
}

await customObjectsApi.patchNamespacedCustomObject(
Expand Down

0 comments on commit 8b060f9

Please sign in to comment.