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

Resolve pr comments

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-03-22 08:24:43 -04:00
parent 8258e0b59a
commit 98d1868430
7 changed files with 32 additions and 41 deletions

View File

@ -340,7 +340,7 @@ export interface FiberChannelSource {
readOnly: boolean;
}
export interface FlokerSource {
export interface FlockerSource {
datasetName: string;
}
@ -604,7 +604,7 @@ export interface PodVolumeVariants {
ephemeral: EphemeralSource;
fc: FiberChannelSource;
flexVolume: FlexVolumeSource;
flocker: FlokerSource;
flocker: FlockerSource;
gcePersistentDisk: GcePersistentDiskSource;
gitRepo: GitRepoSource;
glusterfs: GlusterFsSource;

View File

@ -14,7 +14,7 @@ import { CephFs } from "./variants/ceph-fs";
import { Cinder } from "./variants/cinder";
import { ConfigMap } from "./variants/config-map";
import { ContainerStorageInterface } from "./variants/container-storage-interface";
import { DownwardApi } from "./variants/downward-api";
import { DownwardAPI } from "./variants/downward-api";
import { EmptyDir } from "./variants/empty-dir";
import { Ephemeral } from "./variants/ephemeral";
import { FiberChannel } from "./variants/fiber-channel";
@ -108,7 +108,7 @@ function renderVolumeVariant({ pod, volume }: VolumeVariantProps): VolumeVariant
if (volume.downwardAPI) {
return {
kind: "downwardAPI",
element: <DownwardApi variant={volume.downwardAPI} pod={pod} volumeName={volume.name} />,
element: <DownwardAPI variant={volume.downwardAPI} pod={pod} volumeName={volume.name} />,
};
}

View File

@ -7,7 +7,7 @@ import React from "react";
import { DrawerItem } from "../../../../drawer";
import type { VolumeVariantComponent } from "../variant-helpers";
export const DownwardApi: VolumeVariantComponent<"downwardAPI"> = (
export const DownwardAPI: VolumeVariantComponent<"downwardAPI"> = (
({ variant: { items }}) => (
<>
<DrawerItem name="Items">

View File

@ -9,8 +9,8 @@ import type { VolumeVariantComponent } from "../variant-helpers";
export const EmptyDir: VolumeVariantComponent<"emptyDir"> = (
({ variant: { medium, sizeLimit }}) => (
<>
<DrawerItem name="Medium" hidden={!medium}>
{medium}
<DrawerItem name="Medium">
{medium || "<node's default medium>"}
</DrawerItem>
<DrawerItem name="Size Limit" hidden={!sizeLimit}>
{sizeLimit}

View File

@ -26,14 +26,14 @@ export const FlexVolume: VolumeVariantComponent<"flexVolume"> = (
<DrawerItem name="Readonly">
{readOnly.toString()}
</DrawerItem>
{
...Object.entries(options)
.map(([key, value]) => (
<DrawerItem key={key} name={`Option: ${key}`}>
{value}
</DrawerItem>
))
}
{
...Object.entries(options)
.map(([key, value]) => (
<DrawerItem key={key} name={`Option: ${key}`}>
{value}
</DrawerItem>
))
}
</>
)
);

View File

@ -23,25 +23,21 @@ export const Projected: VolumeVariantComponent<"projected"> = (
<DrawerItem name="Name">
{secret.name}
</DrawerItem>
{secret.items && (
<DrawerItem name="Items">
<ul>
{secret.items.map(({ key }) => <li key={key}>{key}</li>)}
</ul>
</DrawerItem>
)}
<DrawerItem name="Items">
<ul>
{secret.items?.map(({ key }) => <li key={key}>{key}</li>)}
</ul>
</DrawerItem>
</>
)}
{downwardAPI && (
<>
<DrawerTitle size="sub-title">Downward API</DrawerTitle>
{downwardAPI.items && (
<DrawerItem name="Items">
<ul>
{downwardAPI.items.map(({ path }) => <li key={path}>{path}</li>)}
</ul>
</DrawerItem>
)}
<DrawerItem name="Items">
<ul>
{downwardAPI.items?.map(({ path }) => <li key={path}>{path}</li>)}
</ul>
</DrawerItem>
</>
)}
{configMap && (
@ -50,13 +46,11 @@ export const Projected: VolumeVariantComponent<"projected"> = (
<DrawerItem name="Name">
{configMap.name}
</DrawerItem>
{configMap.items && (
<DrawerItem name="Items">
<ul>
{configMap.items.map(({ path }) => <li key={path}>{path}</li>)}
</ul>
</DrawerItem>
)}
<DrawerItem name="Items">
<ul>
{configMap.items?.map(({ path }) => <li key={path}>{path}</li>)}
</ul>
</DrawerItem>
</>
)}
{serviceAccountToken && (
@ -65,8 +59,8 @@ export const Projected: VolumeVariantComponent<"projected"> = (
<DrawerItem name="Audience" hidden={!serviceAccountToken.audience}>
{serviceAccountToken.audience}
</DrawerItem>
<DrawerItem name="Expiration" hidden={!serviceAccountToken.expirationSeconds}>
{serviceAccountToken.expirationSeconds}s
<DrawerItem name="Expiration">
{String(serviceAccountToken.expirationSeconds || (60*60 /* an hour */))}s
</DrawerItem>
<DrawerItem name="Path">
{serviceAccountToken.path}

View File

@ -26,9 +26,6 @@ export const ScaleIo: VolumeVariantComponent<"scaleIO"> = (
<DrawerItem name="SSL Enabled">
{sslEnabled.toString()}
</DrawerItem>
<DrawerItem name="SSL Enabled">
{sslEnabled.toString()}
</DrawerItem>
<DrawerItem name="Protection Domain Name" hidden={!protectionDomain}>
{protectionDomain}
</DrawerItem>