Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use annotation to fetch host for notebook routing #5

Merged

Conversation

cam-garrison
Copy link
Collaborator

This PR updates the route fetching logic to use the new "service-mesh.opendatahub.io/public-gateway-host-external" namespace annotation when routing to a notebook.

This prevents unnecessary route fetching from the istio-system namespace, and makes the logic between fetching a JupyterHub route from the main dashboard and from a Workbench created in a Data Science Project consistent.

Copy link

@bartoszmajsak bartoszmajsak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job. Just one minor thing, but otherwise - merge away!

@@ -20,5 +20,8 @@ export const getServiceMeshGwHost = async (namespace: string): Promise<string |
name: namespace,
};
const project = await k8sGetResource<NamespaceKind>({ model: NamespaceModel, queryOptions });
return project?.metadata?.annotations?.['opendatahub.io/service-mesh-gw-host'] || null;
return (
project?.metadata?.annotations?.['service-mesh.opendatahub.io/public-gateway-host-external'] ||

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we have service-mesh.opendatahub.io/public-gateway-host-external already in two places can we add it somewhere as a const?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so - the two references are found in the frontend/ and backend/ sections of the codebase respectively - and I don't think that the two share consts (from what I can see).

@cam-garrison cam-garrison merged commit 46a6c5b into maistra:ossm_annotations Jun 26, 2023
bartoszmajsak pushed a commit that referenced this pull request Jun 28, 2023
* update existing annotation reference

* use ns annotation in backend route fetching
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants