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

Push driver config during Init #547

Merged
merged 1 commit into from
Sep 19, 2015
Merged

Push driver config during Init #547

merged 1 commit into from
Sep 19, 2015

Conversation

mrjana
Copy link
Contributor

@mrjana mrjana commented Sep 18, 2015

Currently the driver configuration is pushed through a separate
api. This makes driver configuration possible at any arbitrary
time. This unncessarily complicates the driver implementation.
More importantly the driver does not get access to it's
configuration before it can do the handshake with libnetwork.
This make the internal drivers a little bit different to
external plugins which can get their configuration before the handshake
with libnetwork.

This PR attempts to fix that mismatch between internal drivers and
external plugins.

Signed-off-by: Jana Radhakrishnan mrjana@docker.com

@tomdee
Copy link
Contributor

tomdee commented Sep 18, 2015

Are there any changes to the remote API in this PR? If so, I don't see any updates to remote.md

@mrjana
Copy link
Contributor Author

mrjana commented Sep 18, 2015

@tomdee There are no changes to remote API because of this.

return err
}
updateDriverConfig(c, i.ntype, config, false)
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we remove this call ? and rather initialize config := make(map[string]interface{}) inside the for.
that makes the code easily readable.

@mrjana
Copy link
Contributor Author

mrjana commented Sep 19, 2015

@mavenugo Updated to take care of the comments. PTAL

}

for _, i := range initializers {
if err := i.fn(c, makeDriverConfig(c, i.ntype)); 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.

Can you please make this change in drivers_windows.go and drivers_freebsd.go as well ?

Currently the driver configuration is pushed through a separate
api. This makes driver configuration possible at any arbitrary
time. This unncessarily complicates the driver implementation.
More importantly the driver does not get access to it's
configuration before it can do the handshake with libnetwork.
This make the internal drivers a little bit different to
external plugins which can get their configuration before the handshake
with libnetwork.

This PR attempts to fix that mismatch between internal drivers and
external plugins.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
@mrjana
Copy link
Contributor Author

mrjana commented Sep 19, 2015

@mavenugo Updated again taking care of the comments. PTAL

@mavenugo
Copy link
Contributor

LGTM

mavenugo added a commit that referenced this pull request Sep 19, 2015
Push driver config during `Init`
@mavenugo mavenugo merged commit b0e7a33 into moby:master Sep 19, 2015
@mrjana mrjana deleted the config branch September 19, 2015 17:17
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