{"action":"created","comment":{"url":"https://api.github.com/repos/containernetworking/cni/pulls/comments/80028805","id":80028805,"diff_hunk":"@@ -26,49 +28,99 @@ func main() {\n }\n \n func cmdAdd(args *skel.CmdArgs) error {\n-\tipamConf, err := LoadIPAMConfig(args.StdinData, args.Args)\n+\tipamConf, ipamConf6, err := LoadIPAMConfig(args.StdinData, args.Args)\n \tif err != nil {\n \t\treturn err\n \t}\n \n-\tstore, err := disk.New(ipamConf.Name)\n-\tif err != nil {\n-\t\treturn err\n+\tr := &types.Result{\n+\t\tIP4: nil,\n+\t\tIP6: nil,\n \t}\n-\tdefer store.Close()\n \n-\tallocator, err := NewIPAllocator(ipamConf, store)\n-\tif err != nil {\n-\t\treturn err\n-\t}\n+\tif ipamConf != nil {\n+\t\tstore, err := disk.New(ipamConf.Name)\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\t\tdefer store.Close()\n \n-\tipConf, err := allocator.Get(args.ContainerID)\n-\tif err != nil {\n-\t\treturn err\n+\t\tallocator, err := NewIPAllocator(ipamConf, store)\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\n+\t\tipConf, err := allocator.Get(args.ContainerID)\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\t\tr.IP4 = ipConf\n \t}\n \n-\tr := &types.Result{\n-\t\tIP4: ipConf,\n+\tif ipamConf6 != nil {\n+\t\tstore, err := disk.New(ipamConf6.Name)\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\t\tdefer store.Close()\n+\n+\t\tallocator, err := NewIPAllocator(ipamConf6, store)\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\t\tipConf6, err := allocator.Get(args.ContainerID)\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\t\tr.IP6 = ipConf6\n \t}\n+\n \treturn r.Print()\n }\n \n func cmdDel(args *skel.CmdArgs) error {\n-\tipamConf, err := LoadIPAMConfig(args.StdinData, args.Args)\n+\tvar result [2]error\n+\tipamConf, ipamConf6, err := LoadIPAMConfig(args.StdinData, args.Args)\n \tif err != nil {\n \t\treturn err\n \t}\n \n-\tstore, err := disk.New(ipamConf.Name)\n-\tif err != nil {\n-\t\treturn err\n-\t}\n-\tdefer store.Close()\n+\tif ipamConf != nil {\n+\t\tstore, err := disk.New(ipamConf.Name)\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\t\tdefer store.Close()\n \n-\tallocator, err := NewIPAllocator(ipamConf, store)\n-\tif err != nil {\n-\t\treturn err\n+\t\tallocator, err := NewIPAllocator(ipamConf, store)\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\n+\t\te := allocator.Release(args.ContainerID)\n+\t\tif e != nil {\n+\t\t\tresult[0] = e\n+\t\t}\n \t}\n \n-\treturn allocator.Release(args.ContainerID)\n+\tif ipamConf6 != nil {\n+\t\tstore, err := disk.New(ipamConf6.Name)\n+\t\tif err != nil {\n+\t\t\treturn err","path":"plugins/ipam/host-local/main.go","position":115,"original_position":115,"commit_id":"8e6d7b61dc24766d276ea369bb346bfa183fec29","original_commit_id":"8e6d7b61dc24766d276ea369bb346bfa183fec29","user":{"login":"squeed","id":551378,"avatar_url":"https://avatars.githubusercontent.com/u/551378?v=3","gravatar_id":"","url":"https://api.github.com/users/squeed","html_url":"https://github.com/squeed","followers_url":"https://api.github.com/users/squeed/followers","following_url":"https://api.github.com/users/squeed/following{/other_user}","gists_url":"https://api.github.com/users/squeed/gists{/gist_id}","starred_url":"https://api.github.com/users/squeed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/squeed/subscriptions","organizations_url":"https://api.github.com/users/squeed/orgs","repos_url":"https://api.github.com/users/squeed/repos","events_url":"https://api.github.com/users/squeed/events{/privacy}","received_events_url":"https://api.github.com/users/squeed/received_events","type":"User","site_admin":false},"body":"I'm arguing that, in this case, you are no longer returning `result[0]` generated on line 102. I think you, again, want to get all the \"resource handles\" before proceeding with the \"transaction\".\r\nIt's not that the ipv4 won't be released, but that information is being lost.","created_at":"2016-09-22T12:27:31Z","updated_at":"2016-09-22T12:27:31Z","html_url":"https://github.com/containernetworking/cni/pull/279#discussion_r80028805","pull_request_url":"https://api.github.com/repos/containernetworking/cni/pulls/279","_links":{"self":{"href":"https://api.github.com/repos/containernetworking/cni/pulls/comments/80028805"},"html":{"href":"https://github.com/containernetworking/cni/pull/279#discussion_r80028805"},"pull_request":{"href":"https://api.github.com/repos/containernetworking/cni/pulls/279"}}},"pull_request":{"url":"https://api.github.com/repos/containernetworking/cni/pulls/279","id":80350016,"html_url":"https://github.com/containernetworking/cni/pull/279","diff_url":"https://github.com/containernetworking/cni/pull/279.diff","patch_url":"https://github.com/containernetworking/cni/pull/279.patch","issue_url":"https://api.github.com/repos/containernetworking/cni/issues/279","number":279,"state":"open","locked":false,"title":"Enable IPv6 in the host-local plugin","user":{"login":"achanda","id":2165463,"avatar_url":"https://avatars.githubusercontent.com/u/2165463?v=3","gravatar_id":"","url":"https://api.github.com/users/achanda","html_url":"https://github.com/achanda","followers_url":"https://api.github.com/users/achanda/followers","following_url":"https://api.github.com/users/achanda/following{/other_user}","gists_url":"https://api.github.com/users/achanda/gists{/gist_id}","starred_url":"https://api.github.com/users/achanda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achanda/subscriptions","organizations_url":"https://api.github.com/users/achanda/orgs","repos_url":"https://api.github.com/users/achanda/repos","events_url":"https://api.github.com/users/achanda/events{/privacy}","received_events_url":"https://api.github.com/users/achanda/received_events","type":"User","site_admin":false},"body":"The original PR is here https://github.com/containernetworking/cni/pull/137\r\n\r\ncc @steveeJ @dcbw @tgraf PTAL","created_at":"2016-08-06T20:32:44Z","updated_at":"2016-09-22T12:27:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ba2223f3a22d3bc897627bd77884e216fb9b5b27","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/containernetworking/cni/pulls/279/commits","review_comments_url":"https://api.github.com/repos/containernetworking/cni/pulls/279/comments","review_comment_url":"https://api.github.com/repos/containernetworking/cni/pulls/comments{/number}","comments_url":"https://api.github.com/repos/containernetworking/cni/issues/279/comments","statuses_url":"https://api.github.com/repos/containernetworking/cni/statuses/8e6d7b61dc24766d276ea369bb346bfa183fec29","head":{"label":"achanda:host-local-v6","ref":"host-local-v6","sha":"8e6d7b61dc24766d276ea369bb346bfa183fec29","user":{"login":"achanda","id":2165463,"avatar_url":"https://avatars.githubusercontent.com/u/2165463?v=3","gravatar_id":"","url":"https://api.github.com/users/achanda","html_url":"https://github.com/achanda","followers_url":"https://api.github.com/users/achanda/followers","following_url":"https://api.github.com/users/achanda/following{/other_user}","gists_url":"https://api.github.com/users/achanda/gists{/gist_id}","starred_url":"https://api.github.com/users/achanda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achanda/subscriptions","organizations_url":"https://api.github.com/users/achanda/orgs","repos_url":"https://api.github.com/users/achanda/repos","events_url":"https://api.github.com/users/achanda/events{/privacy}","received_events_url":"https://api.github.com/users/achanda/received_events","type":"User","site_admin":false},"repo":{"id":51886546,"name":"cni","full_name":"achanda/cni","owner":{"login":"achanda","id":2165463,"avatar_url":"https://avatars.githubusercontent.com/u/2165463?v=3","gravatar_id":"","url":"https://api.github.com/users/achanda","html_url":"https://github.com/achanda","followers_url":"https://api.github.com/users/achanda/followers","following_url":"https://api.github.com/users/achanda/following{/other_user}","gists_url":"https://api.github.com/users/achanda/gists{/gist_id}","starred_url":"https://api.github.com/users/achanda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achanda/subscriptions","organizations_url":"https://api.github.com/users/achanda/orgs","repos_url":"https://api.github.com/users/achanda/repos","events_url":"https://api.github.com/users/achanda/events{/privacy}","received_events_url":"https://api.github.com/users/achanda/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/achanda/cni","description":"Container Network Interface","fork":true,"url":"https://api.github.com/repos/achanda/cni","forks_url":"https://api.github.com/repos/achanda/cni/forks","keys_url":"https://api.github.com/repos/achanda/cni/keys{/key_id}","collaborators_url":"https://api.github.com/repos/achanda/cni/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/achanda/cni/teams","hooks_url":"https://api.github.com/repos/achanda/cni/hooks","issue_events_url":"https://api.github.com/repos/achanda/cni/issues/events{/number}","events_url":"https://api.github.com/repos/achanda/cni/events","assignees_url":"https://api.github.com/repos/achanda/cni/assignees{/user}","branches_url":"https://api.github.com/repos/achanda/cni/branches{/branch}","tags_url":"https://api.github.com/repos/achanda/cni/tags","blobs_url":"https://api.github.com/repos/achanda/cni/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/achanda/cni/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/achanda/cni/git/refs{/sha}","trees_url":"https://api.github.com/repos/achanda/cni/git/trees{/sha}","statuses_url":"https://api.github.com/repos/achanda/cni/statuses/{sha}","languages_url":"https://api.github.com/repos/achanda/cni/languages","stargazers_url":"https://api.github.com/repos/achanda/cni/stargazers","contributors_url":"https://api.github.com/repos/achanda/cni/contributors","subscribers_url":"https://api.github.com/repos/achanda/cni/subscribers","subscription_url":"https://api.github.com/repos/achanda/cni/subscription","commits_url":"https://api.github.com/repos/achanda/cni/commits{/sha}","git_commits_url":"https://api.github.com/repos/achanda/cni/git/commits{/sha}","comments_url":"https://api.github.com/repos/achanda/cni/comments{/number}","issue_comment_url":"https://api.github.com/repos/achanda/cni/issues/comments{/number}","contents_url":"https://api.github.com/repos/achanda/cni/contents/{+path}","compare_url":"https://api.github.com/repos/achanda/cni/compare/{base}...{head}","merges_url":"https://api.github.com/repos/achanda/cni/merges","archive_url":"https://api.github.com/repos/achanda/cni/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/achanda/cni/downloads","issues_url":"https://api.github.com/repos/achanda/cni/issues{/number}","pulls_url":"https://api.github.com/repos/achanda/cni/pulls{/number}","milestones_url":"https://api.github.com/repos/achanda/cni/milestones{/number}","notifications_url":"https://api.github.com/repos/achanda/cni/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/achanda/cni/labels{/name}","releases_url":"https://api.github.com/repos/achanda/cni/releases{/id}","deployments_url":"https://api.github.com/repos/achanda/cni/deployments","created_at":"2016-02-17T02:09:08Z","updated_at":"2016-02-17T02:09:09Z","pushed_at":"2016-09-13T04:36:33Z","git_url":"git://github.com/achanda/cni.git","ssh_url":"git@github.com:achanda/cni.git","clone_url":"https://github.com/achanda/cni.git","svn_url":"https://github.com/achanda/cni","homepage":"","size":1406,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"containernetworking:master","ref":"master","sha":"7c579af7898c2e50fc02de711e031408450979a3","user":{"login":"containernetworking","id":18357459,"avatar_url":"https://avatars.githubusercontent.com/u/18357459?v=3","gravatar_id":"","url":"https://api.github.com/users/containernetworking","html_url":"https://github.com/containernetworking","followers_url":"https://api.github.com/users/containernetworking/followers","following_url":"https://api.github.com/users/containernetworking/following{/other_user}","gists_url":"https://api.github.com/users/containernetworking/gists{/gist_id}","starred_url":"https://api.github.com/users/containernetworking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containernetworking/subscriptions","organizations_url":"https://api.github.com/users/containernetworking/orgs","repos_url":"https://api.github.com/users/containernetworking/repos","events_url":"https://api.github.com/users/containernetworking/events{/privacy}","received_events_url":"https://api.github.com/users/containernetworking/received_events","type":"Organization","site_admin":false},"repo":{"id":33429211,"name":"cni","full_name":"containernetworking/cni","owner":{"login":"containernetworking","id":18357459,"avatar_url":"https://avatars.githubusercontent.com/u/18357459?v=3","gravatar_id":"","url":"https://api.github.com/users/containernetworking","html_url":"https://github.com/containernetworking","followers_url":"https://api.github.com/users/containernetworking/followers","following_url":"https://api.github.com/users/containernetworking/following{/other_user}","gists_url":"https://api.github.com/users/containernetworking/gists{/gist_id}","starred_url":"https://api.github.com/users/containernetworking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containernetworking/subscriptions","organizations_url":"https://api.github.com/users/containernetworking/orgs","repos_url":"https://api.github.com/users/containernetworking/repos","events_url":"https://api.github.com/users/containernetworking/events{/privacy}","received_events_url":"https://api.github.com/users/containernetworking/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/containernetworking/cni","description":"Container Network Interface - networking for Linux containers","fork":false,"url":"https://api.github.com/repos/containernetworking/cni","forks_url":"https://api.github.com/repos/containernetworking/cni/forks","keys_url":"https://api.github.com/repos/containernetworking/cni/keys{/key_id}","collaborators_url":"https://api.github.com/repos/containernetworking/cni/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/containernetworking/cni/teams","hooks_url":"https://api.github.com/repos/containernetworking/cni/hooks","issue_events_url":"https://api.github.com/repos/containernetworking/cni/issues/events{/number}","events_url":"https://api.github.com/repos/containernetworking/cni/events","assignees_url":"https://api.github.com/repos/containernetworking/cni/assignees{/user}","branches_url":"https://api.github.com/repos/containernetworking/cni/branches{/branch}","tags_url":"https://api.github.com/repos/containernetworking/cni/tags","blobs_url":"https://api.github.com/repos/containernetworking/cni/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/containernetworking/cni/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/containernetworking/cni/git/refs{/sha}","trees_url":"https://api.github.com/repos/containernetworking/cni/git/trees{/sha}","statuses_url":"https://api.github.com/repos/containernetworking/cni/statuses/{sha}","languages_url":"https://api.github.com/repos/containernetworking/cni/languages","stargazers_url":"https://api.github.com/repos/containernetworking/cni/stargazers","contributors_url":"https://api.github.com/repos/containernetworking/cni/contributors","subscribers_url":"https://api.github.com/repos/containernetworking/cni/subscribers","subscription_url":"https://api.github.com/repos/containernetworking/cni/subscription","commits_url":"https://api.github.com/repos/containernetworking/cni/commits{/sha}","git_commits_url":"https://api.github.com/repos/containernetworking/cni/git/commits{/sha}","comments_url":"https://api.github.com/repos/containernetworking/cni/comments{/number}","issue_comment_url":"https://api.github.com/repos/containernetworking/cni/issues/comments{/number}","contents_url":"https://api.github.com/repos/containernetworking/cni/contents/{+path}","compare_url":"https://api.github.com/repos/containernetworking/cni/compare/{base}...{head}","merges_url":"https://api.github.com/repos/containernetworking/cni/merges","archive_url":"https://api.github.com/repos/containernetworking/cni/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/containernetworking/cni/downloads","issues_url":"https://api.github.com/repos/containernetworking/cni/issues{/number}","pulls_url":"https://api.github.com/repos/containernetworking/cni/pulls{/number}","milestones_url":"https://api.github.com/repos/containernetworking/cni/milestones{/number}","notifications_url":"https://api.github.com/repos/containernetworking/cni/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/containernetworking/cni/labels{/name}","releases_url":"https://api.github.com/repos/containernetworking/cni/releases{/id}","deployments_url":"https://api.github.com/repos/containernetworking/cni/deployments","created_at":"2015-04-05T03:35:49Z","updated_at":"2016-09-22T05:58:32Z","pushed_at":"2016-09-21T20:10:31Z","git_url":"git://github.com/containernetworking/cni.git","ssh_url":"git@github.com:containernetworking/cni.git","clone_url":"https://github.com/containernetworking/cni.git","svn_url":"https://github.com/containernetworking/cni","homepage":"","size":3076,"stargazers_count":311,"watchers_count":311,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":94,"mirror_url":null,"open_issues_count":79,"forks":94,"open_issues":79,"watchers":311,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/containernetworking/cni/pulls/279"},"html":{"href":"https://github.com/containernetworking/cni/pull/279"},"issue":{"href":"https://api.github.com/repos/containernetworking/cni/issues/279"},"comments":{"href":"https://api.github.com/repos/containernetworking/cni/issues/279/comments"},"review_comments":{"href":"https://api.github.com/repos/containernetworking/cni/pulls/279/comments"},"review_comment":{"href":"https://api.github.com/repos/containernetworking/cni/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/containernetworking/cni/pulls/279/commits"},"statuses":{"href":"https://api.github.com/repos/containernetworking/cni/statuses/8e6d7b61dc24766d276ea369bb346bfa183fec29"}}}}
{"actor":{"display_login":"squeed"}}