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

Fix cluster dashboard opening and state refreshing #1006

Merged
merged 2 commits into from
Oct 1, 2020

Conversation

nevalla
Copy link
Contributor

@nevalla nevalla commented Oct 1, 2020

This PR fixes cluster dashboard opening so that auth proxy is not opened multiple times. Also cluster state is refreshed now also when cluster is not accessible/online, to automatically get cluster dashboard back when the cluster connection comes back.

Cluster overview does not try to refresh events and metrics anymore if cluster is not available.

Signed-off-by: Lauri Nevala lauri.nevala@gmail.com

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
@nevalla nevalla added the bug Something isn't working label Oct 1, 2020
@@ -110,7 +111,7 @@ export class Cluster implements ClusterModel {

protected bindEvents() {
logger.info(`[CLUSTER]: bind events`, this.getMeta());
const refreshTimer = setInterval(() => this.online && this.refresh(), 30000); // every 30s
const refreshTimer = setInterval(() => !this.disconnected && this.refresh(), 30000); // every 30s
Copy link
Contributor Author

@nevalla nevalla Oct 1, 2020

Choose a reason for hiding this comment

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

We want to refresh connection status even when cluster is offline/not accessible, to get dashboard opened automatically when the connection comes back online.

@@ -44,8 +44,8 @@ export class App extends React.Component {
const clusterId = getHostedClusterId();
logger.info(`[APP]: Init dashboard, clusterId=${clusterId}, frameId=${frameId}`)
await Terminal.preloadFonts()
await clusterIpc.activate.invokeFromRenderer(clusterId, frameId);
await getHostedCluster().whenReady; // cluster.refresh() is done at this point
await clusterIpc.setFrameId.invokeFromRenderer(clusterId, frameId);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ClusterStatus component will activate the cluster so at this point we only need to sync frame id.

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
@nevalla nevalla requested a review from a team October 1, 2020 07:48
Copy link
Contributor

@aleksfront aleksfront left a comment

Choose a reason for hiding this comment

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

LGTM!

@nevalla nevalla added this to the 3.6.6 milestone Oct 1, 2020
@nevalla nevalla merged commit 135282d into master Oct 1, 2020
@nevalla nevalla deleted the fix-cluster-opening-and-refresh branch October 1, 2020 08:16
nevalla added a commit that referenced this pull request Oct 1, 2020
* Fix cluster dashboard opening and state refreshing

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
Nokel81 pushed a commit to Nokel81/lens that referenced this pull request Oct 1, 2020
* Fix cluster dashboard opening and state refreshing

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
nevalla added a commit that referenced this pull request Oct 2, 2020
* Fix cluster dashboard opening and state refreshing (#1006) 

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
@nevalla nevalla mentioned this pull request Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants