1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 15:29:42 +02:00

chore(deps): upgrade eslint and use eslint-plugin (#4989)

This commit is contained in:
Chaim Lev-Ari 2021-08-24 07:34:18 +03:00 committed by GitHub
parent 5fd92d8a3f
commit ab30793c48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 789 additions and 689 deletions

View file

@ -20,28 +20,20 @@ class KubernetesVolumeService {
* GET
*/
async getAsync(namespace, name) {
try {
const [pvc, pool] = await Promise.all([this.KubernetesPersistentVolumeClaimService.get(namespace, name), this.KubernetesResourcePoolService.get(namespace)]);
return KubernetesVolumeConverter.pvcToVolume(pvc, pool);
} catch (err) {
throw err;
}
const [pvc, pool] = await Promise.all([this.KubernetesPersistentVolumeClaimService.get(namespace, name), this.KubernetesResourcePoolService.get(namespace)]);
return KubernetesVolumeConverter.pvcToVolume(pvc, pool);
}
async getAllAsync(namespace) {
try {
const data = await this.KubernetesResourcePoolService.get(namespace);
const pools = data instanceof Array ? data : [data];
const res = await Promise.all(
_.map(pools, async (pool) => {
const pvcs = await this.KubernetesPersistentVolumeClaimService.get(pool.Namespace.Name);
return _.map(pvcs, (pvc) => KubernetesVolumeConverter.pvcToVolume(pvc, pool));
})
);
return _.flatten(res);
} catch (err) {
throw err;
}
const data = await this.KubernetesResourcePoolService.get(namespace);
const pools = data instanceof Array ? data : [data];
const res = await Promise.all(
_.map(pools, async (pool) => {
const pvcs = await this.KubernetesPersistentVolumeClaimService.get(pool.Namespace.Name);
return _.map(pvcs, (pvc) => KubernetesVolumeConverter.pvcToVolume(pvc, pool));
})
);
return _.flatten(res);
}
get(namespace, name) {
@ -55,11 +47,7 @@ class KubernetesVolumeService {
* DELETE
*/
async deleteAsync(volume) {
try {
await this.KubernetesPersistentVolumeClaimService.delete(volume.PersistentVolumeClaim);
} catch (err) {
throw err;
}
await this.KubernetesPersistentVolumeClaimService.delete(volume.PersistentVolumeClaim);
}
delete(volume) {