= ({value, pod}) => {
const kind = _.get(getVolumeType(value.volume), 'id', '');
const loc = getVolumeLocation(value.volume);
const name = value.name;
+ const namespace = pod.metadata.namespace;
const permission = value.readOnly ? 'Read-only' : 'Read/Write';
return
@@ -67,8 +68,7 @@ const VolumeRow: React.FC = ({value, pod}) => {
{_.get(m, 'subPath', '-')}
-
- {loc && ` (${loc})`}
+
{permission}
diff --git a/frontend/public/module/k8s/index.ts b/frontend/public/module/k8s/index.ts
index 6a3f23be59e..e14f6a99bb5 100644
--- a/frontend/public/module/k8s/index.ts
+++ b/frontend/public/module/k8s/index.ts
@@ -244,6 +244,7 @@ export type PodStatus = {
export type PodTemplate = {
spec: PodSpec;
+ metadata: ObjectMetadata;
};
export type PodKind = {
diff --git a/frontend/public/module/k8s/pods.ts b/frontend/public/module/k8s/pods.ts
index f7c2cd7a517..14f22002522 100644
--- a/frontend/public/module/k8s/pods.ts
+++ b/frontend/public/module/k8s/pods.ts
@@ -51,6 +51,7 @@ export const VolumeSource = {
},
secret: {
id: 'secret',
+ link: 'Secret',
label: 'Secret',
description: 'Secret to populate volume.',
},
@@ -76,6 +77,7 @@ export const VolumeSource = {
},
configMap: {
id: 'configMap',
+ link: 'ConfigMap',
label: 'ConfigMap',
description: 'ConfigMap to be consumed in volume.',
},
@@ -84,6 +86,12 @@ export const VolumeSource = {
label: 'Projected',
description: 'A projected volume maps several existing volume sources into the same directory.',
},
+ persistentVolumeClaim: {
+ id: 'persistentVolumeClaim',
+ link: 'PersistentVolumeClaim',
+ label: 'Persistent Volume Claim',
+ description: 'A Persistent Volume Claim is a request for a Persistent Volume',
+ },
};
export const getVolumeType = (volume: Volume) => {
@@ -101,12 +109,18 @@ const genericFormatter = volInfo => {
if (key === 'readOnly') {
return '';
}
+ if (key === 'defaultMode') {
+ return '';
+ }
+ if (key === 'optional') {
+ return '';
+ }
return volInfo[key];
});
if (keys.indexOf('readOnly') !== -1) {
parts.push(volInfo.readOnly ? 'ro' : 'rw');
}
- return parts.join(' ') || null;
+ return parts.join(' ').trim() || null;
};
export const getVolumeLocation = (volume: Volume) => {
@@ -121,9 +135,7 @@ export const getVolumeLocation = (volume: Volume) => {
// Override any special formatting cases.
case VolumeSource.gitRepo.id:
return `${info.repository}:${info.revision}`;
- case VolumeSource.configMap.id:
case VolumeSource.emptyDir.id:
- case VolumeSource.secret.id:
case VolumeSource.projected.id:
return null;
// Defaults to space separated sorted keys.