{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/17504","labels_url":"https://api.github.com/repos/docker/docker/issues/17504/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/17504/comments","events_url":"https://api.github.com/repos/docker/docker/issues/17504/events","html_url":"https://github.com/docker/docker/pull/17504","id":114144325,"number":17504,"title":"Let the api to choose the default network driver.","user":{"login":"calavera","id":1050,"avatar_url":"https://avatars.githubusercontent.com/u/1050?v=3","gravatar_id":"","url":"https://api.github.com/users/calavera","html_url":"https://github.com/calavera","followers_url":"https://api.github.com/users/calavera/followers","following_url":"https://api.github.com/users/calavera/following{/other_user}","gists_url":"https://api.github.com/users/calavera/gists{/gist_id}","starred_url":"https://api.github.com/users/calavera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calavera/subscriptions","organizations_url":"https://api.github.com/users/calavera/orgs","repos_url":"https://api.github.com/users/calavera/repos","events_url":"https://api.github.com/users/calavera/events{/privacy}","received_events_url":"https://api.github.com/users/calavera/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/status/2-code-review","name":"status/2-code-review","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/41","html_url":"https://github.com/docker/docker/milestones/1.9.0","labels_url":"https://api.github.com/repos/docker/docker/milestones/41/labels","id":1211905,"number":41,"title":"1.9.0","description":"","creator":{"login":"dmp42","id":332946,"avatar_url":"https://avatars.githubusercontent.com/u/332946?v=3","gravatar_id":"","url":"https://api.github.com/users/dmp42","html_url":"https://github.com/dmp42","followers_url":"https://api.github.com/users/dmp42/followers","following_url":"https://api.github.com/users/dmp42/following{/other_user}","gists_url":"https://api.github.com/users/dmp42/gists{/gist_id}","starred_url":"https://api.github.com/users/dmp42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmp42/subscriptions","organizations_url":"https://api.github.com/users/dmp42/orgs","repos_url":"https://api.github.com/users/dmp42/repos","events_url":"https://api.github.com/users/dmp42/events{/privacy}","received_events_url":"https://api.github.com/users/dmp42/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":198,"state":"open","created_at":"2015-07-16T20:50:09Z","updated_at":"2015-10-29T21:01:25Z","due_on":"2015-11-03T05:00:00Z","closed_at":null},"comments":11,"created_at":"2015-10-29T20:54:54Z","updated_at":"2015-10-29T22:43:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/17504","html_url":"https://github.com/docker/docker/pull/17504","diff_url":"https://github.com/docker/docker/pull/17504.diff","patch_url":"https://github.com/docker/docker/pull/17504.patch"},"body":"That way swarm can understand the user's intention.\n\n@tiborvass it turns out that we already have a bunch of tests in integration-cli/docker_api_network_test.go that already assume the driver is an empty string and let the daemon to select `bridge` as default network. I added an extra test here, but I don't think it's necessary.\n\nCloses #17500\n\nSigned-off-by: David Calavera <david.calavera@gmail.com>"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/152348275","html_url":"https://github.com/docker/docker/pull/17504#issuecomment-152348275","issue_url":"https://api.github.com/repos/docker/docker/issues/17504","id":152348275,"user":{"login":"calavera","id":1050,"avatar_url":"https://avatars.githubusercontent.com/u/1050?v=3","gravatar_id":"","url":"https://api.github.com/users/calavera","html_url":"https://github.com/calavera","followers_url":"https://api.github.com/users/calavera/followers","following_url":"https://api.github.com/users/calavera/following{/other_user}","gists_url":"https://api.github.com/users/calavera/gists{/gist_id}","starred_url":"https://api.github.com/users/calavera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calavera/subscriptions","organizations_url":"https://api.github.com/users/calavera/orgs","repos_url":"https://api.github.com/users/calavera/repos","events_url":"https://api.github.com/users/calavera/events{/privacy}","received_events_url":"https://api.github.com/users/calavera/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T22:43:09Z","updated_at":"2015-10-29T22:43:09Z","body":"These are the parameters we send to the api when I run `docker network create --driver bridge foo`:\r\n\r\n```\r\nDEBU[0076] Calling POST /v1.22/networks/create\r\nDEBU[0076] form data: map[\"options\":map[] \"name\":\"newbridge\" \"check_duplicate\":%!q(bool=true) \"driver\":\"bridge\" \"ipam\":map[\"driver\":\"default\" \"config\":[]]]\r\n```\r\n\r\nAnd this is what we send when I run `docker network create bar`:\r\n\r\n```\r\nDEBU[0100] Calling POST /v1.22/networks/create\r\nDEBU[0100] form data: map[\"options\":map[] \"name\":\"bridge2\" \"check_duplicate\":%!q(bool=true) \"driver\":\"\" \"ipam\":map[\"driver\":\"default\" \"config\":[]]]\r\n```\r\n\r\nSee that when I(the user) set the driver to `bridge`, we send that value to the api, but we don't send anything if I don't set the driver.\r\n\r\nMoreover, `docker network create -h` still shows `bridge` as the default option:\r\n\r\n```\r\nUsage:  docker network create [OPTIONS] NETWORK-NAME\r\n\r\nCreates a new network with a name specified by the user\r\n\r\n  --aux-address=map[]      auxiliary ipv4 or ipv6 addresses used by Network driver\r\n  -d, --driver=bridge      Driver to manage the Network\r\n  --gateway=[]             ipv4 or ipv6 Gateway for the master subnet\r\n```"}}