mirror of https://github.com/portainer/portainer
parent
87b486b798
commit
e3a995d515
|
@ -18,6 +18,7 @@ class KubernetesPersistentVolumeClaimConverter {
|
|||
res.Namespace = data.metadata.namespace;
|
||||
res.CreationDate = data.metadata.creationTimestamp;
|
||||
res.Storage = `${data.spec.resources.requests.storage}B`;
|
||||
res.AccessModes = data.spec.accessModes || [];
|
||||
res.StorageClass = _.find(storageClasses, { Name: data.spec.storageClassName });
|
||||
res.Yaml = yaml ? yaml.data : '';
|
||||
res.ApplicationOwner = data.metadata.labels ? data.metadata.labels[KubernetesPortainerApplicationOwnerLabel] : '';
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
*/
|
||||
const _KubernetesStorageClassAccessPolicies = Object.freeze([
|
||||
{
|
||||
Name: 'RWO',
|
||||
Name: 'ReadWriteOnce',
|
||||
Description: 'Allow read-write from a single pod only (RWO)',
|
||||
selected: true,
|
||||
},
|
||||
{
|
||||
Name: 'RWX',
|
||||
Name: 'ReadWriteMany',
|
||||
Description: 'Allow read-write access from one or more pods concurrently (RWX)',
|
||||
selected: false,
|
||||
},
|
||||
|
|
|
@ -11,6 +11,7 @@ const _KubernetesPersistentVolumeClaim = Object.freeze({
|
|||
StorageClass: {}, // KubernetesStorageClass
|
||||
CreationDate: '',
|
||||
ApplicationOwner: '',
|
||||
AccessModes: [],
|
||||
ApplicationName: '',
|
||||
MountPath: '', // used for Application creation from ApplicationFormValues | not used from API conversion
|
||||
Yaml: '',
|
||||
|
|
|
@ -49,15 +49,22 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Storage</td>
|
||||
<td>Storage Class</td>
|
||||
<td data-cy="k8sVolDetail-volStorageClassname">{{ ctrl.volume.PersistentVolumeClaim.StorageClass.Name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Shared Access Policy</td>
|
||||
<td data-cy="k8sVolDetail-volAccessPolicy"
|
||||
>{{ ctrl.state.volumeSharedAccessPolicy }}
|
||||
<portainer-tooltip ng-if="ctrl.state.volumeSharedAccessPolicyTooltip" message="ctrl.state.volumeSharedAccessPolicyTooltip"></portainer-tooltip
|
||||
></td>
|
||||
<td>Access Modes</td>
|
||||
<td data-cy="k8sVolDetail-volAccessPolicy">
|
||||
<div ng-repeat="(index, accessPolicy) in ctrl.state.volumeSharedAccessPolicies" class="flex flex-col gap-y-1">
|
||||
<div class="items-center flex gap-x-1">
|
||||
{{ accessPolicy }}
|
||||
<portainer-tooltip
|
||||
ng-if="ctrl.state.volumeSharedAccessPolicyTooltips[index]"
|
||||
message="ctrl.state.volumeSharedAccessPolicyTooltips[index]"
|
||||
></portainer-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Provisioner</td>
|
||||
|
|
|
@ -174,8 +174,8 @@ class KubernetesVolumeController {
|
|||
increaseSize: false,
|
||||
volumeSize: 0,
|
||||
volumeSizeUnit: 'GB',
|
||||
volumeSharedAccessPolicy: '',
|
||||
volumeSharedAccessPolicyTooltip: '',
|
||||
volumeSharedAccessPolicies: [],
|
||||
volumeSharedAccessPolicyTooltips: '',
|
||||
errors: {
|
||||
volumeSize: false,
|
||||
},
|
||||
|
@ -186,16 +186,12 @@ 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;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.state.volumeSharedAccessPolicies = this.volume.PersistentVolumeClaim.AccessModes;
|
||||
let policies = KubernetesStorageClassAccessPolicies();
|
||||
this.state.volumeSharedAccessPolicyTooltips = this.state.volumeSharedAccessPolicies.map((policy) => {
|
||||
const matchingPolicy = policies.find((p) => p.Name === policy);
|
||||
return matchingPolicy ? matchingPolicy.Description : undefined;
|
||||
});
|
||||
} catch (err) {
|
||||
this.Notifications.error('Failure', err, 'Unable to load view data');
|
||||
} finally {
|
||||
|
|
Loading…
Reference in New Issue