Commit 38507f9
committed
chore: improve the visibility of orphaned containers in logs
When executing the command on a compose file like the one below, orphaned
containers are displayed, but the current implementation does not show
the IDs of these orphaned containers, making them difficult to identify.
```
$ cat compose-full.yaml
services:
test:
image: docker.io/library/busybox:latest
command: ["sleep", "infinity"]
orphan:
image: docker.io/library/busybox:latest
command: ["sleep", "infinity"]
$ cat compose-orphan.yaml
services:
test:
image: docker.io/library/busybox:latest
command: ["sleep", "infinity"]
$ sudo nerdctl compose -f compose-full.yaml up -d
...
$ sudo nerdctl compose -f compose-orphan.yaml down -v
...
WARN[0010] found 1 orphaned containers: [0x4000340000], you can run this command with the --remove-orphans flag to clean it up
...
```
Therefore, this commit modifies to display the IDs of orphaned containers.
Additionally, since there was other logic that performed similar displays,
this commit also modifies it in the same manner.
Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>1 parent 7d79937 commit 38507f9
4 files changed
+11
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
0 commit comments