Skip to content

Commit d239e7e

Browse files
authored
fix dctl infos for stopped containers (#29)
1 parent 5cc84f7 commit d239e7e

File tree

4 files changed

+56
-43
lines changed

4 files changed

+56
-43
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
## 1.3.0 release (2023-06-xx)
1+
## 1.3.1 release (2023-06-26)
2+
3+
* Fix dctl "infos" status for stopped containers.
4+
5+
## 1.3.0 release (2023-06-11)
26

37
* dctl "infos" command check config for each item.
48
* dctl "check-config" refactoring.

cli/Cargo.lock

Lines changed: 46 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dctl"
3-
version = "1.3.0"
3+
version = "1.3.1"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

cli/src/parser/config.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl ComposeItem {
8787
pub fn set_status(&mut self, running_container: isize, all_container: isize) {
8888
let status = if (running_container == all_container) && (all_container > 0) {
8989
ComposeStatus::Running
90-
} else if (running_container == all_container) && (all_container == 0){
90+
} else if running_container == 0 {
9191
ComposeStatus::Stopped
9292
} else if (running_container == all_container) && (all_container == -1) {
9393
ComposeStatus::ConfigError
@@ -273,6 +273,9 @@ mod tests {
273273
compose_item.set_status(0, 0);
274274
assert_eq!(compose_item.status, Some(ComposeStatus::Stopped));
275275

276+
compose_item.set_status(0, 6);
277+
assert_eq!(compose_item.status, Some(ComposeStatus::Stopped));
278+
276279
compose_item.set_status(2, 3);
277280
assert_eq!(compose_item.status, Some(ComposeStatus::PartialRunning));
278281

0 commit comments

Comments
 (0)