filter bound PVs when creating PVC

This commit is contained in:
Nancy Butler 2020-09-16 16:15:09 -07:00
parent bc5bec82b0
commit cc2af79b09
1 changed files with 11 additions and 1 deletions

View File

@ -50,8 +50,18 @@ export default {
return this.storageClasses.map(sc => sc.metadata.name); return this.storageClasses.map(sc => sc.metadata.name);
}, },
unboundPVs() {
return this.persistentVolumes.reduce((total, each) => {
if (each?.status?.phase !== 'bound') {
total.push(each);
}
return total;
}, []);
},
persistentVolumeNames() { persistentVolumeNames() {
return this.persistentVolumes.map(pv => pv.metadata.name); return this.unboundPVs.map(pv => pv.metadata.name);
}, },
...mapGetters({ t: 'i18n/t' }) ...mapGetters({ t: 'i18n/t' })