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's apiUrl #846

Merged
merged 3 commits into from
Sep 10, 2020
Merged

Fix cluster's apiUrl #846

merged 3 commits into from
Sep 10, 2020

Conversation

nevalla
Copy link
Contributor

@nevalla nevalla commented Sep 10, 2020

Fixes #845

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

@nevalla nevalla added the bug Something isn't working label Sep 10, 2020
@nevalla nevalla added this to the 3.6.0 milestone Sep 10, 2020
@nevalla nevalla requested a review from a team September 10, 2020 07:34
@@ -82,8 +82,7 @@ export class Cluster implements ClusterModel {
@action
updateModel(model: ClusterModel) {
Object.assign(this, model);
this.apiUrl = this.getKubeconfig().getCurrentCluster()?.server;
this.contextName = this.contextName || this.preferences.clusterName;
this.apiUrl = this.getKubeconfig().getCluster(this.getKubeconfig().getContextObject(this.contextName).cluster).server
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's better to move this.getKubeconfig() into some const before this line to avoid parsing kubeconfig twice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Also moved this assign into constructor, since it's not going to change.

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
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 merged commit e005985 into master Sep 10, 2020
@nevalla nevalla deleted the fix/cluster-api-url branch September 10, 2020 12:15
This was referenced Sep 11, 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.

Cluster is showing wrong api url
2 participants