mirror of
https://github.com/portainer/portainer.git
synced 2025-08-09 07:45:22 +02:00
fix error when editiing non-exitent pvc
This commit is contained in:
parent
0ca56ddbb1
commit
87a33ad268
1 changed files with 9 additions and 7 deletions
|
@ -397,14 +397,16 @@ class KubernetesApplicationHelper {
|
|||
static generatePersistedFoldersFormValuesFromPersistedFolders(persistedFolders, persistentVolumeClaims) {
|
||||
const finalRes = _.map(persistedFolders, (folder) => {
|
||||
const pvc = _.find(persistentVolumeClaims, (item) => _.startsWith(item.Name, folder.PersistentVolumeClaimName));
|
||||
if (pvc) {
|
||||
const res = new KubernetesApplicationPersistedFolderFormValue(pvc.StorageClass);
|
||||
res.PersistentVolumeClaimName = folder.PersistentVolumeClaimName;
|
||||
res.Size = parseInt(pvc.Storage, 10);
|
||||
res.SizeUnit = pvc.Storage.slice(-2);
|
||||
res.ContainerPath = folder.MountPath;
|
||||
return res;
|
||||
}
|
||||
});
|
||||
return finalRes;
|
||||
return finalRes.filter((item) => item !== undefined);
|
||||
}
|
||||
|
||||
static generateVolumesFromPersistentVolumClaims(app, volumeClaims) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue