mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Enable object-shorthand rule (#1500)
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
1 parent
2a8cfe5e67
commit
ff93760dc4
42 files changed
+69
-66
No files matched your search
@@ -8,7 +8,7 @@ export class ClusterApi extends KubeApi<Cluster> {
|
||||
|
||||
async getMetrics(nodeNames: string[], params?: IMetricsReqParams): Promise<IClusterMetrics> {
|
||||
const nodes = nodeNames.join("|");
|
||||
const opts = { category: "cluster", nodes: nodes };
|
||||
const opts = { category: "cluster", nodes };
|
||||
|
||||
return metricsApi.getMetrics({
|
||||
memoryUsage: opts,
|
||||
|
||||
@@ -20,7 +20,7 @@ export class DeploymentApi extends KubeApi<Deployment> {
|
||||
data: {
|
||||
metadata: params,
|
||||
spec: {
|
||||
replicas: replicas
|
||||
replicas
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -119,7 +119,7 @@ export const helmReleasesApi = {
|
||||
const path = endpoint({ name, namespace }) + "/rollback";
|
||||
return apiBase.put(path, {
|
||||
data: {
|
||||
revision: revision
|
||||
revision
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@ export class JsonApi<D = JsonApiData, P extends JsonApiParams = JsonApiParams> {
|
||||
}
|
||||
const infoLog: JsonApiLog = {
|
||||
method: reqInit.method.toUpperCase(),
|
||||
reqUrl: reqUrl,
|
||||
reqInit: reqInit,
|
||||
reqUrl,
|
||||
reqInit,
|
||||
};
|
||||
return cancelableFetch(reqUrl, reqInit).then(res => {
|
||||
return this.parseResponse<D>(res, infoLog);
|
||||
|
||||
@@ -73,7 +73,7 @@ export function forCluster<T extends KubeObject>(cluster: IKubeApiCluster, kubeC
|
||||
});
|
||||
return new KubeApi({
|
||||
objectConstructor: kubeClass,
|
||||
request: request
|
||||
request
|
||||
});
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ export class KubeApi<T extends KubeObject = any> {
|
||||
apiVersion: this.apiVersionWithGroup,
|
||||
resource: this.apiResource,
|
||||
namespace: this.isNamespaced ? namespace : undefined,
|
||||
name: name,
|
||||
name,
|
||||
});
|
||||
return resourcePath + (query ? `?` + stringify(this.normalizeQuery(query)) : "");
|
||||
}
|
||||
@@ -256,7 +256,7 @@ export class KubeApi<T extends KubeObject = any> {
|
||||
this.setResourceVersion("", metadata.resourceVersion);
|
||||
return items.map(item => new KubeObjectConstructor({
|
||||
kind: this.kind,
|
||||
apiVersion: apiVersion,
|
||||
apiVersion,
|
||||
...item,
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user