diff --git a/app/kubernetes/views/volumes/edit/volume.html b/app/kubernetes/views/volumes/edit/volume.html index 462da7649..55e65e649 100644 --- a/app/kubernetes/views/volumes/edit/volume.html +++ b/app/kubernetes/views/volumes/edit/volume.html @@ -37,6 +37,17 @@ Storage {{ ctrl.volume.PersistentVolumeClaim.StorageClass.Name }} + + Shared Access Policy + {{ ctrl.state.volumeSharedAccessPolicy }} + + Provisioner {{ ctrl.volume.PersistentVolumeClaim.StorageClass.Provisioner ? ctrl.volume.PersistentVolumeClaim.StorageClass.Provisioner : '-' }} diff --git a/app/kubernetes/views/volumes/edit/volumeController.js b/app/kubernetes/views/volumes/edit/volumeController.js index 304657298..98ccaa268 100644 --- a/app/kubernetes/views/volumes/edit/volumeController.js +++ b/app/kubernetes/views/volumes/edit/volumeController.js @@ -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 {