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

Have resources initialized before deleting overlay network #1071

Merged
merged 1 commit into from
Apr 4, 2016
Merged

Have resources initialized before deleting overlay network #1071

merged 1 commit into from
Apr 4, 2016

Conversation

aboch
Copy link
Contributor

@aboch aboch commented Apr 4, 2016

  • Otherwise a overlay network delete after daemon restart
    will hit a nil pointer dereference while releasing the
    vxlan id

Steps to reproduce:

  • create an overlay network
  • restart the daemon
  • delete the overlay network

Signed-off-by: Alessandro Boch aboch@docker.com

@mavenugo
Copy link
Contributor

mavenugo commented Apr 4, 2016

LGTM

@@ -109,6 +109,11 @@ func (d *driver) DeleteNetwork(nid string) error {
return fmt.Errorf("could not find network with id %s", nid)
}

// Make sure driver resources are initialized before proceeding
if err := d.configure(); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

You should do this before trying to get d.network because it may depend on the configuration to be completed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After the introduction of the datastore update, config() now only contains the vxlan idm initialization.
But I agree if in future we add more stuff in configure(), then it is better to have it executed at the beginning of this function.

- Otherwise a overlay network delete after daemon restart
  will hit a nil pointer dereference while releasing the
  vxlan id

Signed-off-by: Alessandro Boch <aboch@docker.com>
@aboch
Copy link
Contributor Author

aboch commented Apr 4, 2016

@mrjana
Taken care of your comment. PTAL when you get a chance.

@mrjana
Copy link
Contributor

mrjana commented Apr 4, 2016

LGTM

@mrjana mrjana merged commit 362e780 into moby:master Apr 4, 2016
@aboch aboch deleted the obl branch August 5, 2016 06:07
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.

4 participants