-
Notifications
You must be signed in to change notification settings - Fork 38
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
Web view #18
base: master
Are you sure you want to change the base?
Web view #18
Conversation
Thanks for this draft PR, much appreciate your contributions. Now, in general, before creating an PR it's a good practice to raise an issue to describe what you want to achieve. This issue allows us then to discuss the scope and validity of a feature. Like, in this case, I'm somewhat on the fence: on the one hand I like the feature a lot and think it would lead to a better UX, on the other hand it works against the do-one-thing-and-do-it-well nature. @luksa what are your thoughts? |
I was actually the one who suggested adding the option of opening the graph in the browser directly. But I expected this to be done as part of the kubectl-rback plugin, not in rback directly (exactly because of the do-one-thing philosophy). Also, my idea was to remove the need to have graphviz installed and instead have the plugin just open the .dot file in http://magjac.com/graphviz-visual-editor/, since that editor has some nice interactive features (for our use-case I would remove the editor pane and show just the graph). The customized version of graphviz-visual-editor could also be integrated into the plugin itself, so the RBAC data doesn't leave the local machine. I'm on vacation, so I can't do a proper review of this until next month. |
Graph created with the example rules is too large to be used with http://magjac.com/graphviz-visual-editor/?dot=... - this results in I made some modifications to the code. Graphs are rendered with viz.js (graphviz built using emscripten) - same library I also removed PNG export option, since it is not needed for the web view. The changed feature is still a part of the Edit: I also tried to use dagrejs for rendering, but I did not manage to render any of the example graphs using it. |
Web view
Generates a svg image using viz.js, adds an option to pan it (using svg-pan-zoom library), and opens the graph in a browser.
Library was included in a similar way as in svgpan in pprof.
$ kubectl get sa,roles,rolebindings,clusterroles,clusterrolebindings --all-namespaces -o json | rback -web
Other changes
GO111MODULE=on
GOOS=darwin
andGOARCH=amd64
for macOS build