add the namespace label to CronJobDrawer & IngressDrawer (#24485)
Signed-off-by: sebalaini <sebastianolaini@gmail.com>
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user