revert: Bollard update rolled back, closes #66
Using Bollard 0.19.x meant that network stats weren't being recorded correctly. Updated local unhealthy container to use a speed test in order to check for network IO.
This commit is contained in:
@@ -342,54 +342,6 @@ impl From<(&str, &ContainerStatus)> for State {
|
||||
}
|
||||
}
|
||||
|
||||
/// Need status, to check if container is unhealthy or not
|
||||
impl
|
||||
From<(
|
||||
&bollard::secret::ContainerSummaryStateEnum,
|
||||
&ContainerStatus,
|
||||
)> for State
|
||||
{
|
||||
fn from(
|
||||
(input, status): (
|
||||
&bollard::secret::ContainerSummaryStateEnum,
|
||||
&ContainerStatus,
|
||||
),
|
||||
) -> Self {
|
||||
match input {
|
||||
bollard::secret::ContainerSummaryStateEnum::DEAD => Self::Dead,
|
||||
bollard::secret::ContainerSummaryStateEnum::EXITED => Self::Exited,
|
||||
bollard::secret::ContainerSummaryStateEnum::PAUSED => Self::Paused,
|
||||
bollard::secret::ContainerSummaryStateEnum::REMOVING => Self::Removing,
|
||||
bollard::secret::ContainerSummaryStateEnum::RESTARTING => Self::Restarting,
|
||||
bollard::secret::ContainerSummaryStateEnum::RUNNING => {
|
||||
if status.unhealthy() {
|
||||
Self::Running(RunningState::Unhealthy)
|
||||
} else {
|
||||
Self::Running(RunningState::Healthy)
|
||||
}
|
||||
}
|
||||
_ => Self::Unknown,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Again, need status, to check if container is unhealthy or not
|
||||
impl
|
||||
From<(
|
||||
Option<&bollard::secret::ContainerSummaryStateEnum>,
|
||||
&ContainerStatus,
|
||||
)> for State
|
||||
{
|
||||
fn from(
|
||||
(input, status): (
|
||||
Option<&bollard::secret::ContainerSummaryStateEnum>,
|
||||
&ContainerStatus,
|
||||
),
|
||||
) -> Self {
|
||||
input.map_or(Self::Unknown, |input| Self::from((input, status)))
|
||||
}
|
||||
}
|
||||
|
||||
/// Again, need status, to check if container is unhealthy or not
|
||||
impl From<(Option<String>, &ContainerStatus)> for State {
|
||||
fn from((input, status): (Option<String>, &ContainerStatus)) -> Self {
|
||||
|
||||
Reference in New Issue
Block a user