add the namespace label to CronJobDrawer & IngressDrawer (#24485)

Signed-off-by: sebalaini <sebastianolaini@gmail.com>
This commit is contained in:
Seba
2024-04-26 20:28:17 +02:00
committed by GitHub
parent f34ac5bcb2
commit 3102a99f48
3 changed files with 19 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-kubernetes-react': patch
---
add the namespace label to CronJobDrawer & IngressDrawer.
@@ -19,6 +19,7 @@ import { V1Ingress } from '@kubernetes/client-node';
import { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';
import Typography from '@material-ui/core/Typography';
import Grid from '@material-ui/core/Grid';
import Chip from '@material-ui/core/Chip';
export const IngressDrawer = ({
ingress,
@@ -27,6 +28,7 @@ export const IngressDrawer = ({
ingress: V1Ingress;
expanded?: boolean;
}) => {
const namespace = ingress.metadata?.namespace;
return (
<KubernetesStructuredMetadataTableDrawer
object={ingress}
@@ -53,6 +55,11 @@ export const IngressDrawer = ({
Ingress
</Typography>
</Grid>
{namespace && (
<Grid item>
<Chip size="small" label={`namespace: ${namespace}`} />
</Grid>
)}
</Grid>
</KubernetesStructuredMetadataTableDrawer>
);
@@ -19,6 +19,7 @@ import { V1Service } from '@kubernetes/client-node';
import { KubernetesStructuredMetadataTableDrawer } from '../KubernetesDrawer';
import Typography from '@material-ui/core/Typography';
import Grid from '@material-ui/core/Grid';
import Chip from '@material-ui/core/Chip';
export const ServiceDrawer = ({
service,
@@ -27,6 +28,7 @@ export const ServiceDrawer = ({
service: V1Service;
expanded?: boolean;
}) => {
const namespace = service.metadata?.namespace;
return (
<KubernetesStructuredMetadataTableDrawer
object={service}
@@ -53,6 +55,11 @@ export const ServiceDrawer = ({
Service
</Typography>
</Grid>
{namespace && (
<Grid item>
<Chip size="small" label={`namespace: ${namespace}`} />
</Grid>
)}
</Grid>
</KubernetesStructuredMetadataTableDrawer>
);