{"action":"created","comment":{"url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/pulls/comments/87768567","pull_request_review_id":8365106,"id":87768567,"diff_hunk":"@@ -126,18 +140,26 @@ def read(key)\n   end\n \n   # Write a node\n-  def write(node)\n-    path = node.key\n+  def write(path, **attrs)\n+    @index += 1\n \n-    @nodes[path] = node\n+    @nodes[path] = node = child_node = Node.new(path, @index, **attrs)\n \n     # create parent dirs\n     until path == '/'\n       path = File.dirname(path)\n       parent = mkdir(path)\n-      parent.nodes[node.key] = node\n-      node = parent\n+      parent.nodes[node.key] = child_node\n+      child_node = parent\n     end\n+\n+    node\n+  end\n+\n+  def update(node, value)\n+    @index += 1\n+\n+    node.modify(@index, value)\n   end\n \n   def remove(node, toplevel: true)","path":"lib/etcd/fake_server.rb","position":79,"original_position":79,"commit_id":"c491e6a9df5636b50d6189c33597cc4d173b71fb","original_commit_id":"c491e6a9df5636b50d6189c33597cc4d173b71fb","user":{"login":"jnummelin","id":3205505,"avatar_url":"https://avatars.githubusercontent.com/u/3205505?v=3","gravatar_id":"","url":"https://api.github.com/users/jnummelin","html_url":"https://github.com/jnummelin","followers_url":"https://api.github.com/users/jnummelin/followers","following_url":"https://api.github.com/users/jnummelin/following{/other_user}","gists_url":"https://api.github.com/users/jnummelin/gists{/gist_id}","starred_url":"https://api.github.com/users/jnummelin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnummelin/subscriptions","organizations_url":"https://api.github.com/users/jnummelin/orgs","repos_url":"https://api.github.com/users/jnummelin/repos","events_url":"https://api.github.com/users/jnummelin/events{/privacy}","received_events_url":"https://api.github.com/users/jnummelin/received_events","type":"User","site_admin":false},"body":"`remove` should probably also increment the index","created_at":"2016-11-14T10:00:53Z","updated_at":"2016-11-14T10:04:49Z","html_url":"https://github.com/kontena/kontena-docker-ipam-plugin/pull/61#discussion_r87768567","pull_request_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/pulls/61","_links":{"self":{"href":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/pulls/comments/87768567"},"html":{"href":"https://github.com/kontena/kontena-docker-ipam-plugin/pull/61#discussion_r87768567"},"pull_request":{"href":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/pulls/61"}}},"pull_request":{"url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/pulls/61","id":93357231,"html_url":"https://github.com/kontena/kontena-docker-ipam-plugin/pull/61","diff_url":"https://github.com/kontena/kontena-docker-ipam-plugin/pull/61.diff","patch_url":"https://github.com/kontena/kontena-docker-ipam-plugin/pull/61.patch","issue_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/issues/61","number":61,"state":"open","locked":false,"title":"Improved kontena-ipam-cleanup","user":{"login":"SpComb","id":3950373,"avatar_url":"https://avatars.githubusercontent.com/u/3950373?v=3","gravatar_id":"","url":"https://api.github.com/users/SpComb","html_url":"https://github.com/SpComb","followers_url":"https://api.github.com/users/SpComb/followers","following_url":"https://api.github.com/users/SpComb/following{/other_user}","gists_url":"https://api.github.com/users/SpComb/gists{/gist_id}","starred_url":"https://api.github.com/users/SpComb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpComb/subscriptions","organizations_url":"https://api.github.com/users/SpComb/orgs","repos_url":"https://api.github.com/users/SpComb/repos","events_url":"https://api.github.com/users/SpComb/events{/privacy}","received_events_url":"https://api.github.com/users/SpComb/received_events","type":"User","site_admin":false},"body":"Follows #60 \r\n\r\n* Split out `DockerClient` with `ipam_networks_addresses do |network, pool, addresses| ... end`\r\n* Refactor `Addresses::Cleanup < Mutations::Command` to be per-pool\r\n* Split out `Commands::Cleanup` with options\r\n* Add support for etcd indexes, with `EtcdModel#etcd_modified? after_index: ...`\r\n* Add support for `kontena-ipam-clean --etcd-index-upto=...` for safe address cleanup\r\n\r\n    Fixes #53 \r\n\r\n    Handled automatically for `--docker-networks` cleanup.\r\n\r\n## Usage\r\n\r\n```\r\nUsage: kontena-ipam-cleanup [--docker-networks] [--pool POOL IPADDR...]\r\n        --etcd-index-upto=INDEX      Only cleanup nodes created <= given etcd index\r\n        --docker-networks            Cleanup Docker networks\r\n        --pool=POOL                  Cleanup given pool using adddresses given\r\n```\r\n\r\nWithout any options, the script does nothing.","created_at":"2016-11-11T16:18:14Z","updated_at":"2016-11-14T10:04:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e072d3bdf1a9c07f01d2493dd978576206a84d75","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/pulls/61/commits","review_comments_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/pulls/61/comments","review_comment_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/issues/61/comments","statuses_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/statuses/c491e6a9df5636b50d6189c33597cc4d173b71fb","head":{"label":"kontena:fix/addresses-cleanup-delay","ref":"fix/addresses-cleanup-delay","sha":"c491e6a9df5636b50d6189c33597cc4d173b71fb","user":{"login":"kontena","id":10419574,"avatar_url":"https://avatars.githubusercontent.com/u/10419574?v=3","gravatar_id":"","url":"https://api.github.com/users/kontena","html_url":"https://github.com/kontena","followers_url":"https://api.github.com/users/kontena/followers","following_url":"https://api.github.com/users/kontena/following{/other_user}","gists_url":"https://api.github.com/users/kontena/gists{/gist_id}","starred_url":"https://api.github.com/users/kontena/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kontena/subscriptions","organizations_url":"https://api.github.com/users/kontena/orgs","repos_url":"https://api.github.com/users/kontena/repos","events_url":"https://api.github.com/users/kontena/events{/privacy}","received_events_url":"https://api.github.com/users/kontena/received_events","type":"Organization","site_admin":false},"repo":{"id":65309680,"name":"kontena-docker-ipam-plugin","full_name":"kontena/kontena-docker-ipam-plugin","owner":{"login":"kontena","id":10419574,"avatar_url":"https://avatars.githubusercontent.com/u/10419574?v=3","gravatar_id":"","url":"https://api.github.com/users/kontena","html_url":"https://github.com/kontena","followers_url":"https://api.github.com/users/kontena/followers","following_url":"https://api.github.com/users/kontena/following{/other_user}","gists_url":"https://api.github.com/users/kontena/gists{/gist_id}","starred_url":"https://api.github.com/users/kontena/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kontena/subscriptions","organizations_url":"https://api.github.com/users/kontena/orgs","repos_url":"https://api.github.com/users/kontena/repos","events_url":"https://api.github.com/users/kontena/events{/privacy}","received_events_url":"https://api.github.com/users/kontena/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kontena/kontena-docker-ipam-plugin","description":"Kontena Docker IP Address Management Plugin","fork":false,"url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin","forks_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/forks","keys_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/teams","hooks_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/hooks","issue_events_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/events","assignees_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/tags","blobs_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/languages","stargazers_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/stargazers","contributors_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/contributors","subscribers_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/subscribers","subscription_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/subscription","commits_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/merges","archive_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/downloads","issues_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/labels{/name}","releases_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/deployments","created_at":"2016-08-09T16:12:52Z","updated_at":"2016-11-01T11:27:45Z","pushed_at":"2016-11-11T17:22:25Z","git_url":"git://github.com/kontena/kontena-docker-ipam-plugin.git","ssh_url":"git@github.com:kontena/kontena-docker-ipam-plugin.git","clone_url":"https://github.com/kontena/kontena-docker-ipam-plugin.git","svn_url":"https://github.com/kontena/kontena-docker-ipam-plugin","homepage":"","size":223,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":1,"default_branch":"master"}},"base":{"label":"kontena:master","ref":"master","sha":"d45cb65631963fa9a70b64b5d44fbc9dcb585f35","user":{"login":"kontena","id":10419574,"avatar_url":"https://avatars.githubusercontent.com/u/10419574?v=3","gravatar_id":"","url":"https://api.github.com/users/kontena","html_url":"https://github.com/kontena","followers_url":"https://api.github.com/users/kontena/followers","following_url":"https://api.github.com/users/kontena/following{/other_user}","gists_url":"https://api.github.com/users/kontena/gists{/gist_id}","starred_url":"https://api.github.com/users/kontena/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kontena/subscriptions","organizations_url":"https://api.github.com/users/kontena/orgs","repos_url":"https://api.github.com/users/kontena/repos","events_url":"https://api.github.com/users/kontena/events{/privacy}","received_events_url":"https://api.github.com/users/kontena/received_events","type":"Organization","site_admin":false},"repo":{"id":65309680,"name":"kontena-docker-ipam-plugin","full_name":"kontena/kontena-docker-ipam-plugin","owner":{"login":"kontena","id":10419574,"avatar_url":"https://avatars.githubusercontent.com/u/10419574?v=3","gravatar_id":"","url":"https://api.github.com/users/kontena","html_url":"https://github.com/kontena","followers_url":"https://api.github.com/users/kontena/followers","following_url":"https://api.github.com/users/kontena/following{/other_user}","gists_url":"https://api.github.com/users/kontena/gists{/gist_id}","starred_url":"https://api.github.com/users/kontena/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kontena/subscriptions","organizations_url":"https://api.github.com/users/kontena/orgs","repos_url":"https://api.github.com/users/kontena/repos","events_url":"https://api.github.com/users/kontena/events{/privacy}","received_events_url":"https://api.github.com/users/kontena/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kontena/kontena-docker-ipam-plugin","description":"Kontena Docker IP Address Management Plugin","fork":false,"url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin","forks_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/forks","keys_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/teams","hooks_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/hooks","issue_events_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/events","assignees_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/tags","blobs_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/languages","stargazers_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/stargazers","contributors_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/contributors","subscribers_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/subscribers","subscription_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/subscription","commits_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/merges","archive_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/downloads","issues_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/labels{/name}","releases_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/deployments","created_at":"2016-08-09T16:12:52Z","updated_at":"2016-11-01T11:27:45Z","pushed_at":"2016-11-11T17:22:25Z","git_url":"git://github.com/kontena/kontena-docker-ipam-plugin.git","ssh_url":"git@github.com:kontena/kontena-docker-ipam-plugin.git","clone_url":"https://github.com/kontena/kontena-docker-ipam-plugin.git","svn_url":"https://github.com/kontena/kontena-docker-ipam-plugin","homepage":"","size":223,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/pulls/61"},"html":{"href":"https://github.com/kontena/kontena-docker-ipam-plugin/pull/61"},"issue":{"href":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/issues/61"},"comments":{"href":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/issues/61/comments"},"review_comments":{"href":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/pulls/61/comments"},"review_comment":{"href":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/pulls/61/commits"},"statuses":{"href":"https://api.github.com/repos/kontena/kontena-docker-ipam-plugin/statuses/c491e6a9df5636b50d6189c33597cc4d173b71fb"}}}}
{"actor":{"display_login":"jnummelin"}}