Skip to content
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

Merged
merged 1 commit into from
Jan 8, 2019

Conversation

thaJeztah
Copy link
Member

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)

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@@ -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)
Copy link
Member Author

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

Copy link
Collaborator

@vdemeester vdemeester left a 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 😅

@thaJeztah
Copy link
Member Author

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]>
@codecov-io
Copy link

Codecov Report

Merging #1571 into master will increase coverage by 0.03%.
The diff coverage is 100%.

@@            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

Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@silvin-lubecki silvin-lubecki merged commit edf6f4a into docker:master Jan 8, 2019
@GordonTheTurtle GordonTheTurtle added this to the 19.03.0 milestone Jan 8, 2019
@thaJeztah thaJeztah deleted the warn_on_create branch February 10, 2019 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants