mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
cleanup
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
ef32476d49
commit
c82f411a68
@ -87,10 +87,6 @@ export class ClusterManager {
|
|||||||
|
|
||||||
protected async addNewCluster(clusterData: ClusterBaseInfo): Promise<Cluster> {
|
protected async addNewCluster(clusterData: ClusterBaseInfo): Promise<Cluster> {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
|
|
||||||
logger.info(`*******addNewCluster: ${JSON.stringify(clusterData)}`)
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const kc = this.loadKubeConfig(clusterData.kubeConfigPath)
|
const kc = this.loadKubeConfig(clusterData.kubeConfigPath)
|
||||||
k8s.validateConfig(kc)
|
k8s.validateConfig(kc)
|
||||||
|
|||||||
@ -8,28 +8,24 @@ import { KubeAuthProxy } from "./kube-auth-proxy"
|
|||||||
import { Cluster, ClusterPreferences } from "./cluster"
|
import { Cluster, ClusterPreferences } from "./cluster"
|
||||||
import { prometheusProviders } from "../common/prometheus-providers"
|
import { prometheusProviders } from "../common/prometheus-providers"
|
||||||
import { PrometheusService, PrometheusProvider } from "./prometheus/provider-registry"
|
import { PrometheusService, PrometheusProvider } from "./prometheus/provider-registry"
|
||||||
import { PrometheusLens } from "./prometheus/lens"
|
|
||||||
import { KubeconfigManager } from "./kubeconfig-manager"
|
|
||||||
|
|
||||||
export class ContextHandler {
|
export class ContextHandler {
|
||||||
public contextName: string
|
public contextName: string
|
||||||
public id: string
|
public id: string
|
||||||
public url: string
|
public url: string
|
||||||
|
public clusterUrl: url.UrlWithStringQuery
|
||||||
|
public proxyServer: KubeAuthProxy
|
||||||
|
public proxyPort: number
|
||||||
public certData: string
|
public certData: string
|
||||||
public authCertData: string
|
public authCertData: string
|
||||||
public cluster: Cluster
|
public cluster: Cluster
|
||||||
|
|
||||||
protected apiTarget: ServerOptions
|
protected apiTarget: ServerOptions
|
||||||
protected proxyTarget: ServerOptions
|
protected proxyTarget: ServerOptions
|
||||||
public clusterUrl: url.UrlWithStringQuery
|
|
||||||
public proxyServer: KubeAuthProxy
|
|
||||||
|
|
||||||
protected clientCert: string
|
protected clientCert: string
|
||||||
protected clientKey: string
|
protected clientKey: string
|
||||||
protected secureApiConnection = true
|
protected secureApiConnection = true
|
||||||
protected defaultNamespace: string
|
protected defaultNamespace: string
|
||||||
public proxyPort: number
|
|
||||||
protected kubernetesApi: string
|
protected kubernetesApi: string
|
||||||
protected prometheusProvider: string
|
protected prometheusProvider: string
|
||||||
protected prometheusPath: string
|
protected prometheusPath: string
|
||||||
|
|||||||
@ -59,7 +59,6 @@ class ApiWatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private doneHandler(error: Error) {
|
private doneHandler(error: Error) {
|
||||||
logger.debug("********** watch.doneHandler")
|
|
||||||
if (error) logger.warn("watch ended: " + error.toString())
|
if (error) logger.warn("watch ended: " + error.toString())
|
||||||
|
|
||||||
this.sendEvent({
|
this.sendEvent({
|
||||||
@ -96,7 +95,7 @@ class WatchRoute extends LensApi {
|
|||||||
logger.debug("watch using kubeconfig:" + JSON.stringify(cluster.proxyKubeconfig(), null, 2))
|
logger.debug("watch using kubeconfig:" + JSON.stringify(cluster.proxyKubeconfig(), null, 2))
|
||||||
|
|
||||||
apis.forEach(apiUrl => {
|
apis.forEach(apiUrl => {
|
||||||
const watcher = new ApiWatcher(apiUrl, cluster.proxyKubeconfig() /*cluster.contextHandler.kc*/, response)
|
const watcher = new ApiWatcher(apiUrl, cluster.proxyKubeconfig(), response)
|
||||||
watcher.start()
|
watcher.start()
|
||||||
watchers.push(watcher)
|
watchers.push(watcher)
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user