mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
4e50593a7e
commit
c1679a2249
2 files changed
+4
-4
No files matched your search
@@ -87,7 +87,7 @@ export class KubeStatus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface KubeObjectStatus {
|
export interface KubeObjectStatus {
|
||||||
conditions: {
|
conditions?: {
|
||||||
lastTransitionTime: string;
|
lastTransitionTime: string;
|
||||||
message: string;
|
message: string;
|
||||||
reason: string;
|
reason: string;
|
||||||
|
|||||||
@@ -68,14 +68,14 @@ export class CrdResourceDetails extends React.Component<Props> {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
renderStatus(crd: KubeObject<KubeObjectMetadata, KubeObjectStatus, any>, columns: AdditionalPrinterColumnsV1[]) {
|
renderStatus(customResource: KubeObject<KubeObjectMetadata, KubeObjectStatus, any>, columns: AdditionalPrinterColumnsV1[]) {
|
||||||
const showStatus = !columns.find(column => column.name == "Status") && crd.status?.conditions;
|
const showStatus = !columns.find(column => column.name == "Status") && Array.isArray(customResource.status?.conditions);
|
||||||
|
|
||||||
if (!showStatus) {
|
if (!showStatus) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const conditions = crd.status.conditions
|
const conditions = customResource.status.conditions
|
||||||
.filter(({ type, reason }) => type || reason)
|
.filter(({ type, reason }) => type || reason)
|
||||||
.map(({ type, reason, message, status }) => ({ kind: type || reason, message, status }))
|
.map(({ type, reason, message, status }) => ({ kind: type || reason, message, status }))
|
||||||
.map(({ kind, message, status }, index) => (
|
.map(({ kind, message, status }, index) => (
|
||||||
|
|||||||
Reference in new issue
Block a user