diff --git a/src/ContainerHealthLogs.jsx b/src/ContainerHealthLogs.jsx index d759e078e..e7b31b339 100644 --- a/src/ContainerHealthLogs.jsx +++ b/src/ContainerHealthLogs.jsx @@ -43,9 +43,9 @@ const HealthcheckOnFailureActionText = { }; const ContainerHealthLogs = ({ container, onAddNotification, state }) => { - const healthCheck = container.Config?.Healthcheck ?? container.Config?.Health ?? {}; - const healthState = container.State?.Healthcheck ?? container.State?.Health ?? {}; - const logs = [...(healthState.Log || [])].reverse(); + const healthCheck = container.Config?.Healthcheck ?? container.Config?.Health ?? {}; // not-covered: only on old version + const healthState = container.State?.Healthcheck ?? container.State?.Health ?? {}; // not-covered: only on old version + const logs = [...(healthState.Log || [])].reverse(); // not-covered: Log should always exist, belt-and-suspenders return ( <> diff --git a/src/ContainerIntegration.jsx b/src/ContainerIntegration.jsx index d900ac17c..56fbd0d78 100644 --- a/src/ContainerIntegration.jsx +++ b/src/ContainerIntegration.jsx @@ -17,7 +17,7 @@ export const renderContainerPublishedPorts = ports => { const items = []; Object.entries(ports).forEach(([containerPort, hostBindings]) => { - (hostBindings ?? []).forEach(binding => { + (hostBindings ?? []).forEach(binding => { // not-covered: null was observed in the wild, but unknown how to reproduce items.push( { binding.HostIp || "0.0.0.0" }:{ binding.HostPort } → { containerPort } @@ -88,7 +88,7 @@ const ContainerEnv = ({ containerEnv, imageEnv }) => { }; const ContainerIntegration = ({ container, localImages }) => { - if (localImages === null) { + if (localImages === null) { // not-covered: not a stable UI state return ( ); diff --git a/src/Containers.jsx b/src/Containers.jsx index 4eeee9d2e..04ea20b2d 100644 --- a/src/Containers.jsx +++ b/src/Containers.jsx @@ -380,12 +380,12 @@ class Containers extends React.Component { // this needs to get along with stub containers from image run dialog, where most properties don't exist yet // HACK: Podman renamed `Healthcheck` to `Health` randomly // https://github.com/containers/podman/commit/119973375 - const healthcheck = container.State?.Health?.Status ?? container.State?.Healthcheck?.Status; - const status = container.State?.Status ?? ""; + const healthcheck = container.State?.Health?.Status ?? container.State?.Healthcheck?.Status; // not-covered: only on old version + const status = container.State?.Status ?? ""; // not-covered: race condition let proc = ""; let mem = ""; - if (this.props.cgroupVersion == 'v1' && !container.isSystem && status == 'running') { + if (this.props.cgroupVersion == 'v1' && !container.isSystem && status == 'running') { // not-covered: only on old version proc =
{_("n/a")}
; mem =
{_("n/a")}
; } @@ -641,8 +641,8 @@ class Containers extends React.Component { filtered.sort((a, b) => { // Show unhealthy containers first if (this.props.containers[a] && this.props.containers[b]) { - const a_health = this.props.containers[a].State.Health || this.props.containers[a].State.Healthcheck; - const b_health = this.props.containers[b].State.Health || this.props.containers[b].State.Healthcheck; + const a_health = this.props.containers[a].State.Health || this.props.containers[a].State.Healthcheck; // not-covered: only on old version + const b_health = this.props.containers[b].State.Health || this.props.containers[b].State.Healthcheck; // not-covered: only on old version if (a_health.Status !== b_health.Status) { if (a_health.Status === "unhealthy") return -1;