Add namespace label to argo rollouts in kubernetes (#25467)

* Create fixture for rollouts

Since rollouts have customized support, having a fixture for them can
help in maintaining their rendering.

Signed-off-by: ilias <mail@ilias.xyz>

* Show namespace on Argo Rollout drawers

Signed-off-by: ilias <mail@ilias.xyz>

* Add changeset

Signed-off-by: ilias <mail@ilias.xyz>

* Check namespace shows up on rollouts

Signed-off-by: ilias <mail@ilias.xyz>

---------

Signed-off-by: ilias <mail@ilias.xyz>
This commit is contained in:
Ilias Van Peer
2024-07-02 16:47:10 +02:00
committed by GitHub
parent ea6fb5941c
commit e3cb6abeec
5 changed files with 2938 additions and 0 deletions
@@ -35,6 +35,7 @@ describe('Rollout', () => {
expect(screen.getByText('dice-roller')).toBeInTheDocument();
expect(screen.getByText('Rollout')).toBeInTheDocument();
expect(screen.getByText('namespace: default')).toBeInTheDocument();
expect(screen.getByText('2 pods')).toBeInTheDocument();
expect(screen.getByText('No pods with errors')).toBeInTheDocument();
expect(screen.queryByText('Paused')).toBeNull();
@@ -52,6 +53,7 @@ describe('Rollout', () => {
expect(screen.getByText('dice-roller')).toBeInTheDocument();
expect(screen.getByText('Rollout')).toBeInTheDocument();
expect(screen.getByText('namespace: default')).toBeInTheDocument();
expect(screen.getByText('2 pods')).toBeInTheDocument();
expect(screen.getByText('1 pod with errors')).toBeInTheDocument();
expect(screen.queryByText('Paused')).toBeNull();
@@ -71,6 +73,7 @@ describe('Rollout', () => {
expect(screen.getByText('dice-roller')).toBeInTheDocument();
expect(screen.getByText('Rollout')).toBeInTheDocument();
expect(screen.getByText('namespace: default')).toBeInTheDocument();
expect(screen.getByText('2 pods')).toBeInTheDocument();
expect(screen.getByText('No pods with errors')).toBeInTheDocument();
expect(screen.getByText('Paused (45 minutes ago)')).toBeInTheDocument();
@@ -90,6 +93,7 @@ describe('Rollout', () => {
expect(screen.getByText('dice-roller')).toBeInTheDocument();
expect(screen.getByText('Rollout')).toBeInTheDocument();
expect(screen.getByText('namespace: default')).toBeInTheDocument();
expect(screen.getByText('2 pods')).toBeInTheDocument();
expect(screen.getByText('No pods with errors')).toBeInTheDocument();
expect(screen.queryByText('Paused')).toBeNull();
@@ -18,6 +18,7 @@ import React from 'react';
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 RolloutDrawer = ({
rollout,
@@ -26,6 +27,7 @@ export const RolloutDrawer = ({
rollout: any;
expanded?: boolean;
}) => {
const namespace = rollout.metadata?.namespace;
return (
<KubernetesStructuredMetadataTableDrawer
object={rollout}
@@ -50,6 +52,11 @@ export const RolloutDrawer = ({
Rollout
</Typography>
</Grid>
{namespace && (
<Grid item>
<Chip size="small" label={`namespace: ${namespace}`} />
</Grid>
)}
</Grid>
</KubernetesStructuredMetadataTableDrawer>
);