Commit f128aac
committed
fix: refactor pkg/infoutil in order to resolve import cycle
This pull request will add the fields such as `CONTAINER_NAME` and
`IMAGE_NAME` to the journald log entries sent by containers when
`nerdctl run` is run with `--log-driver=journald`.
However, the following `import cycle not allowed` error occurs when trying
to import `containerutil package` in `logging package` in the
implementation to be changed in this pull request.
```
> make
CGO_ENABLED=0 GOOS=linux go -C /local/home/haytok/workspace/nerdctl build -ldflags "-s -w -X github.com/containerd/nerdctl/v2/pkg/version.Version=0d7dc8ec.m -X github.com/containerd/nerdctl/v2/pkg/version.Revision=0d7dc8ec4cda815acfca165b0281e801c4c5ef6e.m" -o /local/home/haytok/workspace/nerdctl/_output/nerdctl ./cmd/nerdctl
package github.com/containerd/nerdctl/v2/cmd/nerdctl
...
imports github.com/containerd/nerdctl/v2/pkg/infoutil: import cycle not allowed
make: *** [nerdctl] Error 1
```
Therefore, this commit refactors `infoutil package` to avoid
`import cycle not allowd` error in the next commit.
Signed-off-by: Hayato Kiwata <haytok@amazon.co.jp>1 parent db20fec commit f128aac
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
82 | 81 | | |
83 | 82 | | |
84 | 83 | | |
85 | | - | |
86 | 84 | | |
87 | 85 | | |
88 | 86 | | |
| |||
0 commit comments