Skip to content

Commit 41caeb5

Browse files
committed
ARTESCA-14895: Replace for loop by map
1 parent 1c03871 commit 41caeb5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

ui/src/services/k8s/Metalk8sLocalVolumeProvider.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,9 @@ export default class Metalk8sLocalVolumeProvider {
8585
public detachVolumes = async (
8686
localPVs: LocalPersistentVolume[],
8787
): Promise<void> => {
88-
const volumeNames = [];
89-
for (const localPV of localPVs) {
90-
// The volume name is the same as the PV name
91-
const volumeName = localPV.metadata.name;
92-
volumeNames.push(volumeName);
93-
}
88+
// The volume name is the same as the PV name
89+
const volumeNames = localPVs.map((localPV) => localPV.metadata.name);
90+
9491
for (const volumeName of volumeNames) {
9592
try {
9693
await this.volumeClient.deleteMetalk8sV1alpha1Volume(volumeName);

0 commit comments

Comments
 (0)