mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
read serverAddress from apiBase
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
5514e98b1d
commit
4d95bc75c6
@ -65,7 +65,7 @@ export class JsonApi<D = JsonApiData, P extends JsonApiParams = JsonApiParams> {
|
|||||||
debug: false
|
debug: false
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(protected config: JsonApiConfig, protected reqInit?: RequestInit) {
|
constructor(public readonly config: JsonApiConfig, protected reqInit?: RequestInit) {
|
||||||
this.config = Object.assign({}, JsonApi.configDefault, config);
|
this.config = Object.assign({}, JsonApi.configDefault, config);
|
||||||
this.reqInit = merge({}, JsonApi.reqInitDefault, reqInit);
|
this.reqInit = merge({}, JsonApi.reqInitDefault, reqInit);
|
||||||
this.parseResponse = this.parseResponse.bind(this);
|
this.parseResponse = this.parseResponse.bind(this);
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import { stringify } from "querystring";
|
|||||||
import { apiKubePrefix, isDevelopment } from "../../common/vars";
|
import { apiKubePrefix, isDevelopment } from "../../common/vars";
|
||||||
import logger from "../../main/logger";
|
import logger from "../../main/logger";
|
||||||
import { apiManager } from "./api-manager";
|
import { apiManager } from "./api-manager";
|
||||||
import { apiKube } from "./index";
|
import { apiBase, apiKube } from "./index";
|
||||||
import { createKubeApiURL, parseKubeApi } from "./kube-api-parse";
|
import { createKubeApiURL, parseKubeApi } from "./kube-api-parse";
|
||||||
import { KubeObjectConstructor, KubeObject, KubeStatus } from "./kube-object";
|
import { KubeObjectConstructor, KubeObject, KubeStatus } from "./kube-object";
|
||||||
import byline from "byline";
|
import byline from "byline";
|
||||||
@ -97,12 +97,12 @@ export interface IKubeApiCluster {
|
|||||||
|
|
||||||
export function forCluster<T extends KubeObject>(cluster: IKubeApiCluster, kubeClass: KubeObjectConstructor<T>): KubeApi<T> {
|
export function forCluster<T extends KubeObject>(cluster: IKubeApiCluster, kubeClass: KubeObjectConstructor<T>): KubeApi<T> {
|
||||||
const request = new KubeJsonApi({
|
const request = new KubeJsonApi({
|
||||||
serverAddress: `http://127.0.0.1:${process.env.LENS_PROXY_PORT}`,
|
serverAddress: apiBase.config.serverAddress,
|
||||||
apiBase: apiKubePrefix,
|
apiBase: apiKubePrefix,
|
||||||
debug: isDevelopment,
|
debug: isDevelopment,
|
||||||
}, {
|
}, {
|
||||||
headers: {
|
headers: {
|
||||||
"Host": `${cluster.metadata.uid}.localhost:${process.env.LENS_PROXY_PORT}`
|
"Host": apiBase.config.serverAddress
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user