mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix loading helm release details (#6318)
* Fix loading helm release details - The helm manifest can sometimes contain KubeJsonApiDataLists instead of just KubeJsonApiData entries - Add additional logging to main for when a route handler throws so that we can gain more context in the future Signed-off-by: Sebastian Malton <sebastian@malton.name> * Update tests Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix usage of getHelmReleaseResources Signed-off-by: Sebastian Malton <sebastian@malton.name> * Add test to verify handling of Lists being returned Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
5e6cf163a2
commit
cdeededa82
12 files changed
+180
-319
No files matched your search
@@ -19,7 +19,6 @@ import { kebabCase } from "lodash/fp";
|
||||
import { Badge } from "../../badge";
|
||||
import { SubTitle } from "../../layout/sub-title";
|
||||
import { Table, TableCell, TableHead, TableRow } from "../../table";
|
||||
import { ReactiveDuration } from "../../duration/reactive-duration";
|
||||
import { Checkbox } from "../../checkbox";
|
||||
import { MonacoEditor } from "../../monaco-editor";
|
||||
import { Spinner } from "../../spinner";
|
||||
@@ -131,12 +130,10 @@ const ResourceGroup = ({
|
||||
<TableCell className="name">Name</TableCell>
|
||||
|
||||
{isNamespaced && <TableCell className="namespace">Namespace</TableCell>}
|
||||
|
||||
<TableCell className="age">Age</TableCell>
|
||||
</TableHead>
|
||||
|
||||
{resources.map(
|
||||
({ creationTimestamp, detailsUrl, name, namespace, uid }) => (
|
||||
({ detailsUrl, name, namespace, uid }) => (
|
||||
<TableRow key={uid}>
|
||||
<TableCell className="name">
|
||||
{detailsUrl ? <Link to={detailsUrl}>{name}</Link> : name}
|
||||
@@ -145,10 +142,6 @@ const ResourceGroup = ({
|
||||
{isNamespaced && (
|
||||
<TableCell className="namespace">{namespace}</TableCell>
|
||||
)}
|
||||
|
||||
<TableCell className="age">
|
||||
<ReactiveDuration timestamp={creationTimestamp} />
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
),
|
||||
)}
|
||||
|
||||
+3
-6
@@ -222,12 +222,12 @@ export class ReleaseDetailsModel {
|
||||
}
|
||||
|
||||
@computed get notes() {
|
||||
return this.details.info.notes;
|
||||
return this.details?.info.notes ?? "";
|
||||
}
|
||||
|
||||
@computed get groupedResources(): MinimalResourceGroup[] {
|
||||
return pipeline(
|
||||
this.details.resources,
|
||||
this.details?.resources ?? [],
|
||||
groupBy((resource) => resource.kind),
|
||||
(grouped) => Object.entries(grouped),
|
||||
|
||||
@@ -271,20 +271,17 @@ export interface MinimalResource {
|
||||
name: string;
|
||||
namespace: string | undefined;
|
||||
detailsUrl: string | undefined;
|
||||
creationTimestamp: string | undefined;
|
||||
}
|
||||
|
||||
const toMinimalResourceFor =
|
||||
(getResourceDetailsUrl: GetResourceDetailsUrl, kind: string) =>
|
||||
(resource: KubeJsonApiData): MinimalResource => {
|
||||
const { creationTimestamp, name, namespace, uid } = resource.metadata;
|
||||
const { name, namespace, uid } = resource.metadata;
|
||||
|
||||
return {
|
||||
uid,
|
||||
name,
|
||||
namespace,
|
||||
creationTimestamp,
|
||||
|
||||
detailsUrl: getResourceDetailsUrl(
|
||||
kind,
|
||||
resource.apiVersion,
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import type { AsyncResult } from "../../../../../common/utils/async-result";
|
||||
|
||||
export interface DetailedHelmRelease {
|
||||
release: HelmReleaseDto;
|
||||
details: HelmReleaseDetails;
|
||||
details?: HelmReleaseDetails;
|
||||
}
|
||||
|
||||
export type RequestDetailedHelmRelease = (
|
||||
|
||||
Reference in new issue
Block a user