-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit removes the anonymous import of the `github.com/coreos/pkg/capnslog` package, which breaks / changes logging in subtle ways. Importing that package has a side-effect due to the `capnslog`'s `init` function, which sets a global logger. By blank-importing it, we "fixed" the order of package-loading so that this does not cause any issues. However, for other services depending on policy-engine (like issue-policies) this side-effect still exists and has to be handled in [weird ways](https://github.com/snyk/issue-policies/blob/fdab20f0b2984340fd78638cd2b1482097c73e61/internal/core/log/log.go#L12). It looks like we've upgraded and changed our code enough to get rid of that import though since this was added - compiling policy-engine and checking the imported modules shows no sign of the `github.com/coreos/pkg` module anymore: ``` $ # before this change: $ go version -m ./policy-engine | rg 'coreos' dep github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU= dep github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= $ # with this change: $ go version -m ./policy-engine | rg 'coreos' $ ``` This means that upstream users can also get rid of code handling this annoying side effect. [NARW-2842]
- Loading branch information
1 parent
35b4d50
commit 127f197
Showing
5 changed files
with
6 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
kind: Fixed | ||
body: '`capnslog` is not imported anymore, removing a logging-sideffect' | ||
time: 2024-01-12T16:37:58.888303+01:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters