Skip to content

Commit

Permalink
fix a small issue
Browse files Browse the repository at this point in the history
Signed-off-by: farodin91 <[email protected]>
  • Loading branch information
farodin91 committed Dec 7, 2024
1 parent 5c0ccb3 commit fa3ce80
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/gateway/HTTPRouteDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function HTTPRouteDetails(props: { name?: string; namespace?: str
httpRoute && [
{
name: 'Hostnames',
value: <LabelListItem labels={httpRoute.hostnames?.map(tls => `${tls}`)} />,
value: <LabelListItem labels={httpRoute.hostnames.map(tls => `${tls}`)} />,
},
]
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/gateway/HTTPRouteList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function HTTPRouteList() {
{
id: 'rules',
label: t('translation|rules'),
getValue: (httpRoute: HTTPRoute) => httpRoute.spec.rules.length,
getValue: (httpRoute: HTTPRoute) => httpRoute.spec.rules?.length,
},
'age',
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h1
class="MuiTypography-root MuiTypography-h1 MuiTypography-noWrap css-yeaech-MuiTypography-root"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h1
class="MuiTypography-root MuiTypography-h1 MuiTypography-noWrap css-yeaech-MuiTypography-root"
>
GRPCRoute
GRPCRoute: default-httproute
</h1>
<div
class="MuiBox-root css-ldp2l3"
Expand Down Expand Up @@ -187,7 +187,7 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h2
class="MuiTypography-root MuiTypography-h2 MuiTypography-noWrap css-m5vcfd-MuiTypography-root"
Expand Down Expand Up @@ -351,7 +351,7 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h2
class="MuiTypography-root MuiTypography-h2 MuiTypography-noWrap css-m5vcfd-MuiTypography-root"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h1
class="MuiTypography-root MuiTypography-h1 MuiTypography-noWrap css-yeaech-MuiTypography-root"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h1
class="MuiTypography-root MuiTypography-h1 MuiTypography-noWrap css-yeaech-MuiTypography-root"
>
Gateway
Gateway: default-gateway
</h1>
<div
class="MuiBox-root css-ldp2l3"
Expand Down Expand Up @@ -202,7 +202,7 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h2
class="MuiTypography-root MuiTypography-h2 MuiTypography-noWrap css-m5vcfd-MuiTypography-root"
Expand Down Expand Up @@ -251,7 +251,7 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h2
class="MuiTypography-root MuiTypography-h2 MuiTypography-noWrap css-m5vcfd-MuiTypography-root"
Expand Down Expand Up @@ -342,7 +342,7 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h2
class="MuiTypography-root MuiTypography-h2 MuiTypography-noWrap css-m5vcfd-MuiTypography-root"
Expand Down Expand Up @@ -391,7 +391,7 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h2
class="MuiTypography-root MuiTypography-h2 MuiTypography-noWrap css-m5vcfd-MuiTypography-root"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h1
class="MuiTypography-root MuiTypography-h1 MuiTypography-noWrap css-yeaech-MuiTypography-root"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h1
class="MuiTypography-root MuiTypography-h1 MuiTypography-noWrap css-yeaech-MuiTypography-root"
>
HTTPRoute
HTTPRoute: default-httproute
</h1>
<div
class="MuiBox-root css-ldp2l3"
Expand Down Expand Up @@ -203,7 +203,7 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h2
class="MuiTypography-root MuiTypography-h2 MuiTypography-noWrap css-m5vcfd-MuiTypography-root"
Expand Down Expand Up @@ -254,7 +254,7 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h2
class="MuiTypography-root MuiTypography-h2 MuiTypography-noWrap css-m5vcfd-MuiTypography-root"
Expand Down Expand Up @@ -303,7 +303,7 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h2
class="MuiTypography-root MuiTypography-h2 MuiTypography-noWrap css-m5vcfd-MuiTypography-root"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class="MuiGrid-root MuiGrid-item css-13i4rnv-MuiGrid-root"
>
<div
class="MuiBox-root css-70qvj9"
class="MuiBox-root css-15xsm7k"
>
<h1
class="MuiTypography-root MuiTypography-h1 MuiTypography-noWrap css-yeaech-MuiTypography-root"
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/lib/k8s/httpRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export interface HTTPRouteRule {
*/
export interface KubeHTTPRoute extends KubeObjectInterface {
spec: {
hostnames: string[];
parentRefs: GatewayParentReference[];
rules: HTTPRouteRule[];
hostnames?: string[];
parentRefs?: GatewayParentReference[];
rules?: HTTPRouteRule[];
[key: string]: any;
};
}
Expand All @@ -42,15 +42,15 @@ class HTTPRoute extends KubeObject<KubeHTTPRoute> {
}

get hostnames(): string[] {
return this.jsonData.spec.hostnames;
return this.jsonData.spec.hostnames || [];
}

get rules(): HTTPRouteRule[] {
return this.jsonData.spec.rules;
return this.jsonData.spec.rules || [];
}

get parentRefs(): GatewayParentReference[] {
return this.jsonData.spec.parentRefs;
return this.jsonData.spec.parentRefs || [];
}

static get pluralName() {
Expand Down

0 comments on commit fa3ce80

Please sign in to comment.