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

Fixes moby/moby#40388, produce an error with invalid address pool #2538

Merged

Conversation

wangyumu
Copy link
Contributor

- What I did
from moby/moby#40388

Things to fix;

  • if base=10.123.0.0 is invalid, it should produce an error
  • if the given configuration file does not contain default-address-pools, it should not reset the value set on the command-line

Originally posted by @thaJeztah in moby/moby#40388 (comment)

This PR will produce an error if given an invalid address pool like base=10.123.0.0,size=24 (missing /16)

- How I did it
if the default address pool is invalid, ConfigLocalScopeDefaultNetworks will return an error, so just return the error rather than omit it and it's quite safe.

The output likes:

Mar 17 00:10:29 master dockerd[12069]: failed to start daemon: Error initializing network controller: error obtaining controller instance: invalid base pool "10.123.0.0": invalid CIDR address: 10.123.0.0

Signed-off-by: Wang Yumu <37442693@qq.com>
@arkodg arkodg requested a review from selansen March 17, 2020 17:11
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks !

@arkodg
Copy link
Contributor

arkodg commented Mar 30, 2020

PTAL @thaJeztah

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@thaJeztah thaJeztah merged commit 6e14077 into moby:master Mar 31, 2020
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Apr 21, 2020
full diff: moby/libnetwork@ef149a9...1a17fb3

- moby/libnetwork#2538 produce an error with invalid address pool
    - addresses moby#40388 dockerd ignores the --default-address-pool option
- moby/libnetwork#2471 DOCKER-USER chain not created when IPTableEnable=false
- moby/libnetwork#2544 Fix NPE due to null value returned by ep.Iface()
    - carries moby/libnetwork#2239 Prevent NPE in addServiceInfoToCluster()
    - addresses moby#37506 Error initializing docker.server while starting daemon by systemd

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Apr 25, 2020
full diff: moby/libnetwork@ef149a9...1a17fb3

- moby/libnetwork#2538 produce an error with invalid address pool
    - addresses moby/moby#40388 dockerd ignores the --default-address-pool option
- moby/libnetwork#2471 DOCKER-USER chain not created when IPTableEnable=false
- moby/libnetwork#2544 Fix NPE due to null value returned by ep.Iface()
    - carries moby/libnetwork#2239 Prevent NPE in addServiceInfoToCluster()
    - addresses moby/moby#37506 Error initializing docker.server while starting daemon by systemd

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: c3808634e7a44fc5b4fb8caacd9d079f7e0a0fee
Component: engine
@wangyumu wangyumu deleted the add-error-invalid-default-address-pools branch June 3, 2020 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants