|
|
|
@ -2,6 +2,7 @@ import angular from 'angular';
|
|
|
|
|
import _ from 'lodash-es';
|
|
|
|
|
import KubernetesVolumeHelper from 'Kubernetes/helpers/volumeHelper';
|
|
|
|
|
import KubernetesEventHelper from 'Kubernetes/helpers/eventHelper';
|
|
|
|
|
import { KubernetesStorageClassAccessPolicies } from 'Kubernetes/models/storage-class/models';
|
|
|
|
|
import filesizeParser from 'filesize-parser';
|
|
|
|
|
|
|
|
|
|
class KubernetesVolumeController {
|
|
|
|
@ -179,6 +180,8 @@ class KubernetesVolumeController {
|
|
|
|
|
volumeSize: 0,
|
|
|
|
|
volumeSizeUnit: 'GB',
|
|
|
|
|
volumeSizeError: false,
|
|
|
|
|
volumeSharedAccessPolicy: '',
|
|
|
|
|
volumeSharedAccessPolicyTooltip: '',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.state.activeTab = this.LocalStorage.getActiveTab('volume');
|
|
|
|
@ -186,6 +189,16 @@ class KubernetesVolumeController {
|
|
|
|
|
try {
|
|
|
|
|
await this.getVolume();
|
|
|
|
|
await this.getEvents();
|
|
|
|
|
if (this.volume.PersistentVolumeClaim.StorageClass !== undefined) {
|
|
|
|
|
this.state.volumeSharedAccessPolicy = this.volume.PersistentVolumeClaim.StorageClass.AccessModes[this.volume.PersistentVolumeClaim.StorageClass.AccessModes.length - 1];
|
|
|
|
|
let policies = KubernetesStorageClassAccessPolicies();
|
|
|
|
|
|
|
|
|
|
policies.forEach((policy) => {
|
|
|
|
|
if (policy.Name == this.state.volumeSharedAccessPolicy) {
|
|
|
|
|
this.state.volumeSharedAccessPolicyTooltip = policy.Description;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
|
|
|
|
this.Notifications.error('Failure', err, 'Unable to load view data');
|
|
|
|
|
} finally {
|
|
|
|
|