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

Slow tabs #861

Merged
merged 2 commits into from Apr 22, 2020
Merged

Slow tabs #861

merged 2 commits into from Apr 22, 2020

Conversation

bryanl
Copy link
Contributor

@bryanl bryanl commented Apr 22, 2020

What this PR does / why we need it:

This change does two things:

  1. In the frontend, redirect only when needed. Before, redirects were happening on every content update. This change sets it to only redirect when the content path has changed.
  2. In the backend, consolidate tab printing for custom resources and non-custom resources. This change also runs the tab generate process concurrently.

Release note:

Consolidate tab printing functions

@bryanl bryanl requested a review from a team April 22, 2020 13:47
@bryanl bryanl self-assigned this Apr 22, 2020
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.

Nice refactor, couple comments that aren't blocker for the merge.

o.tabFuncDescriptors = []Tab{
{Name: "Summary", Factory: SummaryTab},
{Name: "Metadata", Factory: MetadataTab},
{Name: "Resource Viewer", Factory: ResourceViewerTab(false)}, // TODO: Fix me
Copy link
Contributor

Choose a reason for hiding this comment

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

can we create an issue for this fix me with what needs to be fixed, can leave the TODO but have it reference a GH issue.

"github.com/vmware-tanzu/octant/pkg/view/component"
)

func CustomResourceSummaryTab(crdName string) TabFactory {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer to see all of these share the same signature. I'd expect them all to return a TabFactory, not some of them also directly be a TabFactory based on the naming convention. My initial thought is to make them all return a TabFactory and create a TabFactoryOptions type they can accept for the factories that need setup before we do Component generation.

A previous change removed the frontend redirect. It is required to set the current URL when navigating from root.

Signed-off-by: bryanl <bryanliles@gmail.com>
This change consolidates the tab printing function for objects and custom resources. It also runs the tab generate process concurrently.

Signed-off-by: bryanl <bryanliles@gmail.com>
@bryanl bryanl merged commit efac907 into master Apr 22, 2020
@bryanl bryanl deleted the slow-tabs branch April 22, 2020 16:27
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.

None yet

3 participants