Skip to content

Commit

Permalink
Add fallback to KubeObjectMeta if still no details exist
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Malton <[email protected]>
  • Loading branch information
Nokel81 committed Aug 3, 2021
1 parent dc60517 commit 4e50593
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/renderer/components/kube-object/kube-object-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { KubeObjectMenu } from "./kube-object-menu";
import { KubeObjectDetailRegistry } from "../../api/kube-object-detail-registry";
import logger from "../../../main/logger";
import { CrdResourceDetails } from "../+custom-resources";
import { KubeObjectMeta } from "./kube-object-meta";

/**
* Used to store `object.selfLink` to show more info about resource in the details panel.
Expand Down Expand Up @@ -178,6 +179,11 @@ export class KubeObjectDetails extends React.Component {
}
}

if (details.length === 0) {
// if we still don't have any details to show, just show the standard object metadata
details.push(<KubeObjectMeta key={object.getId()} object={object} />);
}

return (
<Drawer
className="KubeObjectDetails flex column"
Expand Down

0 comments on commit 4e50593

Please sign in to comment.