Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Add link generator to DashboardClient #2276

Merged
merged 1 commit into from
Apr 7, 2021

Conversation

GuessWhoSamFoo
Copy link
Contributor

What this PR does / why we need it:

Usage: request.DashboardClient.CreateLink(request.Context(), key)

  • Returns a link response that has a link component with the object's name as the link text as default.

Which issue(s) this PR fixes

Copy link
Contributor

@wwitzel3 wwitzel3 left a comment

Choose a reason for hiding this comment

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

Thank you for checking this one off the list.

@wwitzel3
Copy link
Contributor

wwitzel3 commented Apr 7, 2021

Can you create an issue to add this to an example plugin as well? (in the example plugin repo). I think showing the usage of this will be useful to plugin authors. Also is this worth adding example usage in our Go Plugin storybook doc?

@GuessWhoSamFoo
Copy link
Contributor Author

I'm inclined to say storybook should be for component rather than API documentation. We can add an example plugin and create a page for documenting what DashboardClient can do outside of code comments.

@wwitzel3
Copy link
Contributor

wwitzel3 commented Apr 7, 2021

Where do you see us moving these to? https://reference.octant.dev/?path=/docs/docs-plugins-2-go-plugins--page

@wwitzel3
Copy link
Contributor

wwitzel3 commented Apr 7, 2021

My thought was that having the "how to" plugin guides and component reference in the same place is useful

@GuessWhoSamFoo
Copy link
Contributor Author

That's fine where it is. I'll add sample code in https://github.com/vmware-tanzu/octant-example-plugins

@GuessWhoSamFoo GuessWhoSamFoo merged commit 95e3918 into vmware-archive:master Apr 7, 2021
antoninbas added a commit to antoninbas/antrea that referenced this pull request Oct 30, 2021
We can now support Octant 0.24 (latest version). Older versions (up to
0.19) may be supported as well (not tested).

By updating the Octant module dependency to v0.24.0, we can also start
using the Octant Dashboard client to perform CRUD operations on Antrea
CRDs, thus ensuring that the plugin is always using the correct cluster
context (see antrea-io#1519).

A few other notable things:
* We can remove replace directives in the plugin go.mod file (for now?)
  since K8s dependencies between Antrea and Octant are compatible.
* Octant now has a new logging mechanism for plugins but unfortunately
  it is still buggy so we are not updating our plugin to use it.
* The Dashboard client supports a link generator to easily generate
  links to resources
  (vmware-archive/octant#2276). Unfortunately I
  believe that in practice it would make our plugin code more
  complicated. We can revisit this in the future.

Fixes antrea-io#1519
Fixes antrea-io#2315
Fixes antrea-io#2676

Signed-off-by: Antonin Bas <[email protected]>
antoninbas added a commit to antoninbas/antrea that referenced this pull request Nov 1, 2021
We can now support Octant 0.24 (latest version). Older versions (up to
0.19) may be supported as well (not tested).

By updating the Octant module dependency to v0.24.0, we can also start
using the Octant Dashboard client to perform CRUD operations on Antrea
CRDs, thus ensuring that the plugin is always using the correct cluster
context (see antrea-io#1519).

A few other notable things:
* We can remove replace directives in the plugin go.mod file (for now?)
  since K8s dependencies between Antrea and Octant are compatible.
* Octant now has a new logging mechanism for plugins but unfortunately
  it is still buggy so we are not updating our plugin to use it.
* The Dashboard client supports a link generator to easily generate
  links to resources
  (vmware-archive/octant#2276). Unfortunately I
  believe that in practice it would make our plugin code more
  complicated. We can revisit this in the future.

Fixes antrea-io#1519
Fixes antrea-io#2315
Fixes antrea-io#2676

Signed-off-by: Antonin Bas <[email protected]>
antoninbas added a commit to antoninbas/antrea that referenced this pull request Nov 30, 2021
We can now support Octant 0.24 (latest version). Older versions (up to
0.19) may be supported as well (not tested).

By updating the Octant module dependency to v0.24.0, we can also start
using the Octant Dashboard client to perform CRUD operations on Antrea
CRDs, thus ensuring that the plugin is always using the correct cluster
context (see antrea-io#1519).

A few other notable things:
* We can remove replace directives in the plugin go.mod file (for now?)
  since K8s dependencies between Antrea and Octant are compatible.
* Octant now has a new logging mechanism for plugins but unfortunately
  it is still buggy so we are not updating our plugin to use it.
* The Dashboard client supports a link generator to easily generate
  links to resources
  (vmware-archive/octant#2276). Unfortunately I
  believe that in practice it would make our plugin code more
  complicated. We can revisit this in the future.

Fixes antrea-io#1519
Fixes antrea-io#2315
Fixes antrea-io#2676

Signed-off-by: Antonin Bas <[email protected]>
antoninbas added a commit to antrea-io/antrea that referenced this pull request Dec 2, 2021
* Update Antrea Octant plugin to support latest Octant version

We can now support Octant 0.24 (latest version). Older versions (up to
0.19) may be supported as well (not tested).

By updating the Octant module dependency to v0.24.0, we can also start
using the Octant Dashboard client to perform CRUD operations on Antrea
CRDs, thus ensuring that the plugin is always using the correct cluster
context (see #1519).

A few other notable things:
* We can remove replace directives in the plugin go.mod file (for now?)
  since K8s dependencies between Antrea and Octant are compatible.
* Octant now has a new logging mechanism for plugins but unfortunately
  it is still buggy so we are not updating our plugin to use it.
* The Dashboard client supports a link generator to easily generate
  links to resources
  (vmware-archive/octant#2276). Unfortunately I
  believe that in practice it would make our plugin code more
  complicated. We can revisit this in the future.

Fixes #1519
Fixes #2315
Fixes #2676

Signed-off-by: Antonin Bas <[email protected]>

* Override license detection for github.com/opencontainers/go-digest

Signed-off-by: Antonin Bas <[email protected]>

* Fix Docker build for Antrea Octant plugin

Signed-off-by: Antonin Bas <[email protected]>

* More tweaks for license detection

Signed-off-by: Antonin Bas <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In Go extensions API provide utility method to create the Link ref for the specified Kubernetes object
2 participants