{"action":"created","issue":{"url":"https://api.github.com/repos/docker/libnetwork/issues/127","labels_url":"https://api.github.com/repos/docker/libnetwork/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/docker/libnetwork/issues/127/comments","events_url":"https://api.github.com/repos/docker/libnetwork/issues/127/events","html_url":"https://github.com/docker/libnetwork/pull/127","id":73776401,"number":127,"title":"Remote Driver Registration","user":{"login":"mavenugo","id":5056191,"avatar_url":"https://avatars.githubusercontent.com/u/5056191?v=3","gravatar_id":"","url":"https://api.github.com/users/mavenugo","html_url":"https://github.com/mavenugo","followers_url":"https://api.github.com/users/mavenugo/followers","following_url":"https://api.github.com/users/mavenugo/following{/other_user}","gists_url":"https://api.github.com/users/mavenugo/gists{/gist_id}","starred_url":"https://api.github.com/users/mavenugo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavenugo/subscriptions","organizations_url":"https://api.github.com/users/mavenugo/orgs","repos_url":"https://api.github.com/users/mavenugo/repos","events_url":"https://api.github.com/users/mavenugo/events{/privacy}","received_events_url":"https://api.github.com/users/mavenugo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-07T00:05:15Z","updated_at":"2015-05-11T10:23:53Z","closed_at":"2015-05-07T05:02:19Z","pull_request":{"url":"https://api.github.com/repos/docker/libnetwork/pulls/127","html_url":"https://github.com/docker/libnetwork/pull/127","diff_url":"https://github.com/docker/libnetwork/pull/127.diff","patch_url":"https://github.com/docker/libnetwork/pull/127.patch"},"body":"This commits brings in a functionality for remote drivers to register\r\nwith LibNetwork. The Built-In remote driver is responsible for the\r\nactual \"remote\" plugin to be made available.\r\n\r\nHaving such a mechanism makes libnetwork core not dependent on any\r\nexternal plugin mechanism and also the Libnetwork NB apis are free of\r\nDriver interface.\r\n\r\nSigned-off-by: Madhu Venugopal <madhu@docker.com>"},"comment":{"url":"https://api.github.com/repos/docker/libnetwork/issues/comments/100858545","html_url":"https://github.com/docker/libnetwork/pull/127#issuecomment-100858545","issue_url":"https://api.github.com/repos/docker/libnetwork/issues/127","id":100858545,"user":{"login":"squaremo","id":62033,"avatar_url":"https://avatars.githubusercontent.com/u/62033?v=3","gravatar_id":"","url":"https://api.github.com/users/squaremo","html_url":"https://github.com/squaremo","followers_url":"https://api.github.com/users/squaremo/followers","following_url":"https://api.github.com/users/squaremo/following{/other_user}","gists_url":"https://api.github.com/users/squaremo/gists{/gist_id}","starred_url":"https://api.github.com/users/squaremo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/squaremo/subscriptions","organizations_url":"https://api.github.com/users/squaremo/orgs","repos_url":"https://api.github.com/users/squaremo/repos","events_url":"https://api.github.com/users/squaremo/events{/privacy}","received_events_url":"https://api.github.com/users/squaremo/received_events","type":"User","site_admin":false},"created_at":"2015-05-11T10:23:53Z","updated_at":"2015-05-11T10:23:53Z","body":"This looks strange to me.\r\n\r\nThe `remote.New` implementation creates an unusable driver, which then gets registered. What is supposed to happen if a user refers to the driver `\"remote\"`?\r\n\r\nThe example given (as well as the name) suggests that the `driver` struct is supposed to hold the registration callback -- but this is only available to the special \"remote\" driver (reminder: not a driver), and will be nil for _actual_ remote drivers.\r\n\r\nAs a consequence of this, and I guess a desire for symmetry, every driver now gets passed a `DriverCallback`; but only the remote driver needs it, and it is cheerfully passed as `nil` in most of the tests.\r\n\r\nWouldn't it be better to have a `<driver>.Init`, let the other driver modules register themselves under their own names, and let the remote driver module hook up callbacks from the plugin system as in https://github.com/mavenugo/libnetwork/commit/b3dcb1f ? That way, there's none of the redundancy of passing the registration callback; no storing the callback in a struct which is supposed to be for something else; and there's no spurious driver registered."}}