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