1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Provide link to configMap from pod details (#352)

Signed-off-by: Dan Slinky <dan-slinky@cookpad.jp>
This commit is contained in:
Dan Slinky @ Cookpad 2020-05-08 14:49:04 +01:00 committed by GitHub
parent 2a4704716d
commit 2c3dc8370d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 2 deletions

View File

@ -171,6 +171,9 @@ export class Pod extends WorkloadKubeObject {
medium?: string; medium?: string;
sizeLimit?: string; sizeLimit?: string;
}; };
configMap: {
name: string;
}
secret: { secret: {
secretName: string; secretName: string;
defaultMode: number; defaultMode: number;

View File

@ -6,7 +6,7 @@ import { disposeOnUnmount, observer } from "mobx-react";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import { autorun, observable, reaction, toJS } from "mobx"; import { autorun, observable, reaction, toJS } from "mobx";
import { Trans } from "@lingui/macro"; import { Trans } from "@lingui/macro";
import { IPodMetrics, nodesApi, Pod, podsApi, pvcApi } from "../../api/endpoints"; import { IPodMetrics, nodesApi, Pod, podsApi, pvcApi, configMapApi } from "../../api/endpoints";
import { DrawerItem, DrawerTitle } from "../drawer"; import { DrawerItem, DrawerTitle } from "../drawer";
import { Badge } from "../badge"; import { Badge } from "../badge";
import { autobind, cssNames, interval } from "../../utils"; import { autobind, cssNames, interval } from "../../utils";
@ -176,6 +176,7 @@ export class PodDetails extends React.Component<Props> {
<DrawerTitle title={<Trans>Volumes</Trans>}/> <DrawerTitle title={<Trans>Volumes</Trans>}/>
{volumes.map(volume => { {volumes.map(volume => {
const claimName = volume.persistentVolumeClaim ? volume.persistentVolumeClaim.claimName : null; const claimName = volume.persistentVolumeClaim ? volume.persistentVolumeClaim.claimName : null;
const configMap = volume.configMap ? volume.configMap.name : null;
const type = Object.keys(volume)[1] const type = Object.keys(volume)[1]
return ( return (
@ -187,6 +188,20 @@ export class PodDetails extends React.Component<Props> {
<DrawerItem name={<Trans>Type</Trans>}> <DrawerItem name={<Trans>Type</Trans>}>
{type} {type}
</DrawerItem> </DrawerItem>
{ type == "configMap" && (
<div>
{configMap && (
<DrawerItem name={<Trans>Name</Trans>}>
<Link
to={getDetailsUrl(configMapApi.getUrl({
name: configMap,
namespace: pod.getNs(),
}))}>{configMap}
</Link>
</DrawerItem>
)}
</div>
)}
{ type === "emptyDir" && ( { type === "emptyDir" && (
<div> <div>
{ volume.emptyDir.medium && ( { volume.emptyDir.medium && (