openshift / console-plugin-template

Minimal template for writing OpenShift console plugins
Apache License 2.0
37 stars 47 forks source link

How to develop with other console plugins #68

Closed evanstoner closed 1 week ago

evanstoner commented 3 weeks ago

Hi, I'm a Red Hat ISV partner developing a plugin that will add a horizontal nav tab to the VirtualMachine page. However, the kubevirt-plugin that is loaded and enabled in my OpenShift cluster is not enabled in the local OKD console. How do I load both the plugins that are enabled on the remote cluster, as well as my local plugin in development?

spadgett commented 2 weeks ago

Hi, @evanstoner. Your best bet is to build and run the kubevirt plugin locally from https://github.com/kubevirt-ui/kubevirt-plugin. Then you can change BRIDGE_PLUGINS in the start script to load both plugins:

https://github.com/openshift/console-plugin-template/blob/main/start-console.sh#L45

We can look at adding a way to load both plugins running on the cluster and local plugins for development. It's a little tricky, though, since plugin services aren't exposed through a route, so they can't be loaded by a console running off-cluster.

FYI @vojtechszocs @jhadvig

spadgett commented 2 weeks ago

An alternative might be to expose the plugin service by creating a route on the cluster and point your local console to the plugin route.

evanstoner commented 1 week ago

Exposing the route and adding it to BRIDGE_PLUGINS worked, and avoided local dependency resolution for the KubeVirt plugin. Thanks! FYI I've opened https://github.com/kubevirt-ui/kubevirt-plugin/issues/2085 as a followup.