diff --git a/src/renderer/components/+workloads-pods/pod-details-container.scss b/src/renderer/components/+workloads-pods/pod-details-container.scss index fca42c9433..16d67b1f24 100644 --- a/src/renderer/components/+workloads-pods/pod-details-container.scss +++ b/src/renderer/components/+workloads-pods/pod-details-container.scss @@ -58,4 +58,11 @@ @include pod-status-colors; } -} \ No newline at end of file + + ul.argument-list { + li { + font-family: monospace; + word-break: break-all; + } + } +} diff --git a/src/renderer/components/+workloads-pods/pod-details-container.tsx b/src/renderer/components/+workloads-pods/pod-details-container.tsx index b4a4c5eaf2..26d678427b 100644 --- a/src/renderer/components/+workloads-pods/pod-details-container.tsx +++ b/src/renderer/components/+workloads-pods/pod-details-container.tsx @@ -44,6 +44,8 @@ interface Props { metrics?: { [key: string]: IMetrics }; } +const hiddenPullPolicy = "IfNotPresent"; + @observer export class PodDetailsContainer extends React.Component { @@ -54,36 +56,42 @@ export class PodDetailsContainer extends React.Component { } renderStatus(state: string, status: IPodContainerStatus) { - const ready = status ? status.ready : ""; + if (!state || !status) { + return null; + } return ( - - {state}{ready ? `, ready` : ""} - {state === "terminated" ? ` - ${status.state.terminated.reason} (exit code: ${status.state.terminated.exitCode})` : ""} - + + + {state}{status.ready ? `, ready` : ""} + {state === "terminated" ? ` - ${status.state.terminated.reason} (exit code: ${status.state.terminated.exitCode})` : ""} + + ); } renderLastState(lastState: string, status: IPodContainerStatus) { - if (lastState === "terminated") { - return ( + if (lastState !== "terminated" || !status) { + return null; + } + + return ( + {lastState}
Reason: {status.lastState.terminated.reason} - exit code: {status.lastState.terminated.exitCode}
Started at: {}
Finished at: {}
- ); - } - - return null; +
+ ); } render() { const { pod, container, metrics } = this.props; if (!pod || !container) return null; - const { name, image, imagePullPolicy, ports, volumeMounts, command, args } = container; + const { name, image, imagePullPolicy = hiddenPullPolicy, ports = [], volumeMounts = [], command = [], args = [] } = container; const status = pod.getContainerStatuses().find(status => status.name === container.name); const state = status ? Object.keys(status.state)[0] : ""; const lastState = status ? Object.keys(status.lastState)[0] : ""; @@ -105,97 +113,81 @@ export class PodDetailsContainer extends React.Component {
{name}
- {!isMetricHidden && !isInitContainer && - - - - } - {status && - - {this.renderStatus(state, status)} - - } - {lastState && - - {this.renderLastState(lastState, status)} - - } + {!isMetricHidden && !isInitContainer && ( + + + + )} + + {this.renderStatus(state, status)} + {this.renderLastState(lastState, status)} + - {imagePullPolicy && imagePullPolicy !== "IfNotPresent" && - + + - } - {ports && ports.length > 0 && - - { - ports.map((port) => { - const key = `${container.name}-port-${port.containerPort}-${port.protocol}`; - return ( - - ); - }) - } - - } - {} - {volumeMounts && volumeMounts.length > 0 && - + - } - {liveness.length > 0 && - - { - liveness.map((value, index) => ( - + ports.map((port) => ( + )) } - } - {readiness.length > 0 && - - { - readiness.map((value, index) => ( - - )) - } - - } - {startup.length > 0 && - - { - startup.map((value, index) => ( - - )) - } - - } - {command && - - {command.join(" ")} - - } - {args && - - {args.join(" ")} + + + + + + + + + + + + + - } ); }