-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix cluster's apiUrl #846
Conversation
src/main/cluster.ts
Outdated
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
a743c53
to
1438273
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fixes #845
Signed-off-by: Lauri Nevala lauri.nevala@gmail.com