Skip to content

Commit

Permalink
frontend: Add init and ephemeral containers to the log viewer's choices
Browse files Browse the repository at this point in the history
So users can see logs from those containers.

Signed-off-by: Joaquim Rocha <[email protected]>
  • Loading branch information
joaquimrocha committed Nov 6, 2023
1 parent 795b6dc commit 95c913d
Showing 1 changed file with 30 additions and 6 deletions.
36 changes: 30 additions & 6 deletions frontend/src/components/pod/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,36 @@ function PodLogViewer(props: PodLogViewerProps) {
value={container}
onChange={handleContainerChange}
>
{item &&
item.spec.containers.map(({ name }) => (
<MenuItem value={name} key={name}>
{name}
</MenuItem>
))}
{item?.spec?.containers && (
<MenuItem disabled value="">
{t('glossary|Containers')}
</MenuItem>
)}
{item?.spec?.containers.map(({ name }) => (
<MenuItem value={name} key={name}>
{name}
</MenuItem>
))}
{item?.spec?.initContainers && (
<MenuItem disabled value="">
{t('translation|Init Containers')}
</MenuItem>
)}
{item.spec.initContainers?.map(({ name }) => (
<MenuItem value={name} key={`init_container_${name}`}>
{name}
</MenuItem>
))}
{item?.spec?.ephemeralContainers && (
<MenuItem disabled value="">
{t('glossary|Ephemeral Containers')}
</MenuItem>
)}
{item.spec.ephemeralContainers?.map(({ name }) => (
<MenuItem value={name} key={`eph_container_${name}`}>
{name}
</MenuItem>
))}
</Select>
</FormControl>,
<FormControl className={classes.linesFormControl}>
Expand Down

0 comments on commit 95c913d

Please sign in to comment.