mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix: checkPreferredVersion invalid if-condition
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
b036fdc76b
commit
2db2bc78ae
@ -109,17 +109,16 @@ export class KubeApi<T extends KubeObject = any> {
|
||||
}
|
||||
|
||||
protected async checkPreferredVersion() {
|
||||
if (!this.options.checkPreferredVersion || this.apiVersionPreferred === undefined) {
|
||||
return;
|
||||
}
|
||||
const res = await this.request.get<IKubePreferredVersion>(`${this.apiPrefix}/${this.apiGroup}`);
|
||||
Object.defineProperty(this, "apiVersionPreferred", {
|
||||
value: res?.preferredVersion?.version ?? null,
|
||||
});
|
||||
if (this.options.checkPreferredVersion && this.apiVersionPreferred === undefined) {
|
||||
const res = await this.request.get<IKubePreferredVersion>(`${this.apiPrefix}/${this.apiGroup}`);
|
||||
Object.defineProperty(this, "apiVersionPreferred", {
|
||||
value: res?.preferredVersion?.version ?? null,
|
||||
});
|
||||
|
||||
if (this.apiVersionPreferred) {
|
||||
Object.defineProperty(this, "apiBase", { value: this.getUrl() })
|
||||
apiManager.registerApi(this.apiBase, this);
|
||||
if (this.apiVersionPreferred) {
|
||||
Object.defineProperty(this, "apiBase", { value: this.getUrl() })
|
||||
apiManager.registerApi(this.apiBase, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user