mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Lint: object-curly-spacing (error) (#4198)
This commit is contained in:
1 parent
0759b80435
commit
41863e87ce
89 files changed
+230
-216
No files matched your search
@@ -212,7 +212,7 @@ export function computeDiff(contents: string, source: RootSource, filePath: stri
|
||||
// add new clusters to the source
|
||||
try {
|
||||
const clusterId = createHash("md5").update(`${filePath}:${contextName}`).digest("hex");
|
||||
const cluster = ClusterStore.getInstance().getById(clusterId) || new Cluster({ ...model, id: clusterId});
|
||||
const cluster = ClusterStore.getInstance().getById(clusterId) || new Cluster({ ...model, id: clusterId });
|
||||
|
||||
if (!cluster.apiUrl) {
|
||||
throw new Error("Cluster constructor failed, see above error");
|
||||
|
||||
@@ -100,7 +100,7 @@ export function syncWeblinks() {
|
||||
webLinkEntities.delete(weblinkId);
|
||||
}
|
||||
}
|
||||
}, {fireImmediately: true});
|
||||
}, { fireImmediately: true });
|
||||
|
||||
catalogEntityRegistry.addComputedSource("weblinks", computed(() => Array.from(webLinkEntities.values(), ([link]) => link)));
|
||||
}
|
||||
@@ -35,7 +35,7 @@ export class DetectorRegistry extends Singleton {
|
||||
}
|
||||
|
||||
async detectForCluster(cluster: Cluster): Promise<ClusterMetadata> {
|
||||
const results: {[key: string]: ClusterDetectionResult } = {};
|
||||
const results: { [key: string]: ClusterDetectionResult } = {};
|
||||
|
||||
for (const detectorClass of this.registry) {
|
||||
const detector = new detectorClass(cluster);
|
||||
|
||||
@@ -30,86 +30,86 @@ export class DistributionDetector extends BaseClusterDetector {
|
||||
this.version = await this.getKubernetesVersion();
|
||||
|
||||
if (this.isRke()) {
|
||||
return { value: "rke", accuracy: 80};
|
||||
return { value: "rke", accuracy: 80 };
|
||||
}
|
||||
|
||||
if (this.isRancherDesktop()) {
|
||||
return { value: "rancher-desktop", accuracy: 80};
|
||||
return { value: "rancher-desktop", accuracy: 80 };
|
||||
}
|
||||
|
||||
if (this.isK3s()) {
|
||||
return { value: "k3s", accuracy: 80};
|
||||
return { value: "k3s", accuracy: 80 };
|
||||
}
|
||||
|
||||
if (this.isGKE()) {
|
||||
return { value: "gke", accuracy: 80};
|
||||
return { value: "gke", accuracy: 80 };
|
||||
}
|
||||
|
||||
if (this.isEKS()) {
|
||||
return { value: "eks", accuracy: 80};
|
||||
return { value: "eks", accuracy: 80 };
|
||||
}
|
||||
|
||||
if (this.isIKS()) {
|
||||
return { value: "iks", accuracy: 80};
|
||||
return { value: "iks", accuracy: 80 };
|
||||
}
|
||||
|
||||
if (this.isAKS()) {
|
||||
return { value: "aks", accuracy: 80};
|
||||
return { value: "aks", accuracy: 80 };
|
||||
}
|
||||
|
||||
if (this.isDigitalOcean()) {
|
||||
return { value: "digitalocean", accuracy: 90};
|
||||
return { value: "digitalocean", accuracy: 90 };
|
||||
}
|
||||
|
||||
if (this.isK0s()) {
|
||||
return { value: "k0s", accuracy: 80};
|
||||
return { value: "k0s", accuracy: 80 };
|
||||
}
|
||||
|
||||
if (this.isVMWare()) {
|
||||
return { value: "vmware", accuracy: 90};
|
||||
return { value: "vmware", accuracy: 90 };
|
||||
}
|
||||
|
||||
if (this.isMirantis()) {
|
||||
return { value: "mirantis", accuracy: 90};
|
||||
return { value: "mirantis", accuracy: 90 };
|
||||
}
|
||||
|
||||
if (this.isAlibaba()) {
|
||||
return { value: "alibaba", accuracy: 90};
|
||||
return { value: "alibaba", accuracy: 90 };
|
||||
}
|
||||
|
||||
if (this.isHuawei()) {
|
||||
return { value: "huawei", accuracy: 90};
|
||||
return { value: "huawei", accuracy: 90 };
|
||||
}
|
||||
|
||||
if (this.isTke()) {
|
||||
return { value: "tencent", accuracy: 90};
|
||||
return { value: "tencent", accuracy: 90 };
|
||||
}
|
||||
|
||||
if (this.isMinikube()) {
|
||||
return { value: "minikube", accuracy: 80};
|
||||
return { value: "minikube", accuracy: 80 };
|
||||
}
|
||||
|
||||
if (this.isMicrok8s()) {
|
||||
return { value: "microk8s", accuracy: 80};
|
||||
return { value: "microk8s", accuracy: 80 };
|
||||
}
|
||||
|
||||
if (this.isKind()) {
|
||||
return { value: "kind", accuracy: 70};
|
||||
return { value: "kind", accuracy: 70 };
|
||||
}
|
||||
|
||||
if (this.isDockerDesktop()) {
|
||||
return { value: "docker-desktop", accuracy: 80};
|
||||
return { value: "docker-desktop", accuracy: 80 };
|
||||
}
|
||||
|
||||
if (this.isCustom() && await this.isOpenshift()) {
|
||||
return { value: "openshift", accuracy: 90};
|
||||
return { value: "openshift", accuracy: 90 };
|
||||
}
|
||||
|
||||
if (this.isCustom()) {
|
||||
return { value: "custom", accuracy: 10};
|
||||
return { value: "custom", accuracy: 10 };
|
||||
}
|
||||
|
||||
return { value: "unknown", accuracy: 10};
|
||||
return { value: "unknown", accuracy: 10 };
|
||||
}
|
||||
|
||||
public async getKubernetesVersion() {
|
||||
|
||||
@@ -29,7 +29,7 @@ export class NodesCountDetector extends BaseClusterDetector {
|
||||
if (!this.cluster.accessible) return null;
|
||||
const nodeCount = await this.getNodeCount();
|
||||
|
||||
return { value: nodeCount, accuracy: 100};
|
||||
return { value: nodeCount, accuracy: 100 };
|
||||
}
|
||||
|
||||
protected async getNodeCount(): Promise<number> {
|
||||
|
||||
@@ -29,7 +29,7 @@ export class VersionDetector extends BaseClusterDetector {
|
||||
public async detect() {
|
||||
const version = await this.getKubernetesVersion();
|
||||
|
||||
return { value: version, accuracy: 100};
|
||||
return { value: version, accuracy: 100 };
|
||||
}
|
||||
|
||||
public async getKubernetesVersion() {
|
||||
|
||||
+1
-1
@@ -651,7 +651,7 @@ export class Cluster implements ClusterModel, ClusterState {
|
||||
const api = (await this.getProxyKubeconfig()).makeApiClient(CoreV1Api);
|
||||
|
||||
try {
|
||||
const { body: { items } } = await api.listNamespace();
|
||||
const { body: { items }} = await api.listNamespace();
|
||||
const namespaces = items.map(ns => ns.metadata.name);
|
||||
|
||||
return namespaces;
|
||||
|
||||
@@ -68,7 +68,7 @@ export class FilesystemProvisionerStore extends BaseStore<FSProvisionModel> {
|
||||
}
|
||||
|
||||
@action
|
||||
protected fromStore({ extensions }: FSProvisionModel = { extensions: {} }): void {
|
||||
protected fromStore({ extensions }: FSProvisionModel = { extensions: {}}): void {
|
||||
this.registeredExtensions.merge(extensions);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ export abstract class PrometheusProvider {
|
||||
protected async getFirstNamespacedServer(client: CoreV1Api, ...selectors: string[]): Promise<PrometheusService | undefined> {
|
||||
try {
|
||||
for (const selector of selectors) {
|
||||
const { body: { items: [service] } } = await client.listServiceForAllNamespaces(null, null, null, selector);
|
||||
const { body: { items: [service] }} = await client.listServiceForAllNamespaces(null, null, null, selector);
|
||||
|
||||
if (service) {
|
||||
return {
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ export class Router {
|
||||
};
|
||||
}
|
||||
|
||||
protected static async handleStaticFile({ params, response, raw: { req } }: LensApiRequest): Promise<void> {
|
||||
protected static async handleStaticFile({ params, response, raw: { req }}: LensApiRequest): Promise<void> {
|
||||
let filePath = params.path;
|
||||
|
||||
for (let retryCount = 0; retryCount < 5; retryCount += 1) {
|
||||
|
||||
@@ -63,7 +63,7 @@ function generateKubeConfig(username: string, secret: V1Secret, cluster: Cluster
|
||||
|
||||
export class KubeconfigRoute {
|
||||
static async routeServiceAccountRoute(request: LensApiRequest) {
|
||||
const { params, response, cluster} = request;
|
||||
const { params, response, cluster } = request;
|
||||
const client = (await cluster.getProxyKubeconfig()).makeApiClient(CoreV1Api);
|
||||
const secretList = await client.listNamespacedSecret(params.namespace);
|
||||
const secret = secretList.body.items.find(secret => {
|
||||
|
||||
@@ -27,6 +27,6 @@ export class VersionRoute {
|
||||
static async getVersion(request: LensApiRequest) {
|
||||
const { response } = request;
|
||||
|
||||
respondJson(response, { version: getAppVersion()}, 200);
|
||||
respondJson(response, { version: getAppVersion() }, 200);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user