Skip to content

Commit

Permalink
Fix reading CRD conditions (#967)
Browse files Browse the repository at this point in the history
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
  • Loading branch information
nevalla authored Sep 25, 2020
1 parent d0f1d7b commit 265aa41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/renderer/api/endpoints/cert-manager.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ export class Issuer extends KubeObject {
}

getConditions() {
if (!this.status?.conditions) return [];
const { conditions = [] } = this.status;
return conditions.map(condition => {
const { message, reason, lastTransitionTime, status } = condition;
Expand Down
10 changes: 5 additions & 5 deletions src/renderer/api/endpoints/crd.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ type AdditionalPrinterColumnsCommon = {
description: string;
}

type AdditionalPrinterColumnsV1 = AdditionalPrinterColumnsCommon & {
jsonPath: string;
type AdditionalPrinterColumnsV1 = AdditionalPrinterColumnsCommon & {
jsonPath: string;
}

type AdditionalPrinterColumnsV1Beta = AdditionalPrinterColumnsCommon & {
JSONPath: string;
type AdditionalPrinterColumnsV1Beta = AdditionalPrinterColumnsCommon & {
JSONPath: string;
}

export class CustomResourceDefinition extends KubeObject {
Expand Down Expand Up @@ -132,7 +132,7 @@ export class CustomResourceDefinition extends KubeObject {
}

getConditions() {
if (!this.status.conditions) return [];
if (!this.status?.conditions) return [];
return this.status.conditions.map(condition => {
const { message, reason, lastTransitionTime, status } = condition;
return {
Expand Down

0 comments on commit 265aa41

Please sign in to comment.