mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix kubeconfig-manager tests
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
d22af76e60
commit
3492741b6a
@ -31,6 +31,7 @@ import pathExistsSyncInjectable from "../../common/fs/path-exists-sync.injectabl
|
||||
import readJsonSyncInjectable from "../../common/fs/read-json-sync.injectable";
|
||||
import writeJsonSyncInjectable from "../../common/fs/write-json-sync.injectable";
|
||||
import lensProxyPortInjectable from "../lens-proxy/lens-proxy-port.injectable";
|
||||
import lensProxyCertificateInjectable from "../../common/certificate/lens-proxy-certificate.injectable";
|
||||
|
||||
const clusterServerUrl = "https://192.168.64.3:8443";
|
||||
|
||||
@ -58,6 +59,12 @@ describe("kubeconfig manager tests", () => {
|
||||
di.override(readJsonSyncInjectable, () => () => { throw new Error("tried call readJsonSync without override"); });
|
||||
di.override(writeJsonSyncInjectable, () => () => { throw new Error("tried call writeJsonSync without override"); });
|
||||
|
||||
di.inject(lensProxyCertificateInjectable).set({
|
||||
public: "<public-data>",
|
||||
private: "<private-data>",
|
||||
cert: "<ca-data>",
|
||||
});
|
||||
|
||||
readFileMock = asyncFn();
|
||||
di.override(readFileInjectable, () => readFileMock);
|
||||
writeFileMock = asyncFn();
|
||||
|
||||
@ -110,7 +110,7 @@ export class KubeconfigManager {
|
||||
clusters: [
|
||||
{
|
||||
name: contextName,
|
||||
server: `http://127.0.0.1:${this.dependencies.lensProxyPort.get()}/${this.cluster.id}`,
|
||||
server: `https://127.0.0.1:${this.dependencies.lensProxyPort.get()}/${this.cluster.id}`,
|
||||
skipTLSVerify: false,
|
||||
caData: Buffer.from(certificate.cert).toString("base64"),
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user