-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix warnings not being printed on "create", only on "run" #1571
Conversation
@@ -165,6 +166,9 @@ func createContainer(ctx context.Context, dockerCli command.Cli, containerConfig | |||
networkingConfig := containerConfig.NetworkingConfig | |||
stderr := dockerCli.Err() | |||
|
|||
warnOnOomKillDisable(*hostConfig, stderr) | |||
warnOnLocalhostDNS(*hostConfig, stderr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I actually want to move these warnings to the daemon (similar as to what I did in #1225 / moby/moby#37502, that way the daemon can decide if the container configuration has possible issues, and we can provide warnings for situations where (e.g.) memory-limit is not supported by the daemon, so will be ignored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM 🐯
Seems it needs gofmt though 😅
Ah, boo! I disabled the automatic gofmt, because it keeps messing up my files when switching between repos haha |
Previously, these errors were only printed when using `docker run`, but were omitted when using `docker container create` and `docker container start` separately. Given that these warnings apply to both situations, this patch moves generation of these warnings to `docker container create` (which is also called by `docker run`) Signed-off-by: Sebastiaan van Stijn <[email protected]>
03eca4c
to
7c514a3
Compare
Codecov Report
@@ Coverage Diff @@
## master #1571 +/- ##
==========================================
+ Coverage 55.26% 55.29% +0.03%
==========================================
Files 289 289
Lines 19385 19381 -4
==========================================
+ Hits 10713 10717 +4
+ Misses 7977 7970 -7
+ Partials 695 694 -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Previously, these errors were only printed when using
docker run
, but were omitted when usingdocker container create
anddocker container start
separately.Given that these warnings apply to both situations, this patch moves generation of these warnings to
docker container create
(which is also called bydocker run
)- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)