{"action":"created","comment":{"url":"https://api.github.com/repos/contiv/volplugin/pulls/comments/59052811","id":59052811,"diff_hunk":"@@ -208,12 +253,48 @@ func (c *Client) ListAllVolumes() ([]string, error) {\n \treturn ret, nil\n }\n \n-// WatchVolumes watches the volumes tree and returns data back to the activity channel.\n-func (c *Client) WatchVolumes(activity chan *watch.Watch) {\n+// WatchVolumeRuntimes watches the runtime portions of the volume and yields\n+// back any information received through the activity channel.\n+func (c *Client) WatchVolumeRuntimes(activity chan *watch.Watch) {\n \tw := watch.NewWatcher(activity, c.prefixed(rootVolume), func(resp *client.Response, w *watch.Watcher) {\n \t\tvw := &watch.Watch{Key: strings.Replace(resp.Node.Key, c.prefixed(rootVolume)+\"/\", \"\", -1), Config: nil}\n \n-\t\tif !resp.Node.Dir {\n+\t\tif !resp.Node.Dir && path.Base(resp.Node.Key) == \"runtime\" {\n+\t\t\tlog.Debugf(\"Handling watch event %q for volume %q\", resp.Action, vw.Key)\n+\t\t\tif resp.Action != \"delete\" {\n+\t\t\t\tvolume := &RuntimeOptions{}\n+\n+\t\t\t\tif resp.Node.Value != \"\" {\n+\t\t\t\t\tif err := json.Unmarshal([]byte(resp.Node.Value), volume); err != nil {\n+\t\t\t\t\t\tlog.Errorf(\"Error decoding volume %q, not updating\", resp.Node.Key)\n+\t\t\t\t\t\ttime.Sleep(1 * time.Second)\n+\t\t\t\t\t\treturn\n+\t\t\t\t\t}\n+\n+\t\t\t\t\tif err := volume.Validate(); err != nil {\n+\t\t\t\t\t\tlog.Errorf(\"Error validating volume %q, not updating\", resp.Node.Key)\n+\t\t\t\t\t\ttime.Sleep(1 * time.Second)\n+\t\t\t\t\t\treturn\n+\t\t\t\t\t}\n+\t\t\t\t\tpolicy, vol := path.Split(path.Dir(resp.Node.Key))\n+\t\t\t\t\tvw.Key = path.Join(path.Base(policy), vol)\n+\t\t\t\t\tvw.Config = volume\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\tw.Channel <- vw\n+\t\t}\n+\t})\n+\n+\twatch.Create(w)\n+}\n+\n+// WatchVolumeCreates watches the volumes tree and returns data back to the activity channel.\n+func (c *Client) WatchVolumeCreates(activity chan *watch.Watch) {","path":"config/volume.go","position":265,"original_position":265,"commit_id":"4f0f2ba51464c689b1582852c36d55d700808f4b","original_commit_id":"4f0f2ba51464c689b1582852c36d55d700808f4b","user":{"login":"mapuri","id":9538438,"avatar_url":"https://avatars.githubusercontent.com/u/9538438?v=3","gravatar_id":"","url":"https://api.github.com/users/mapuri","html_url":"https://github.com/mapuri","followers_url":"https://api.github.com/users/mapuri/followers","following_url":"https://api.github.com/users/mapuri/following{/other_user}","gists_url":"https://api.github.com/users/mapuri/gists{/gist_id}","starred_url":"https://api.github.com/users/mapuri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapuri/subscriptions","organizations_url":"https://api.github.com/users/mapuri/orgs","repos_url":"https://api.github.com/users/mapuri/repos","events_url":"https://api.github.com/users/mapuri/events{/privacy}","received_events_url":"https://api.github.com/users/mapuri/received_events","type":"User","site_admin":false},"body":"just curious, why do we need to watch create config? They can't change right?","created_at":"2016-04-08T16:33:17Z","updated_at":"2016-04-08T16:33:17Z","html_url":"https://github.com/contiv/volplugin/pull/209#discussion_r59052811","pull_request_url":"https://api.github.com/repos/contiv/volplugin/pulls/209","_links":{"self":{"href":"https://api.github.com/repos/contiv/volplugin/pulls/comments/59052811"},"html":{"href":"https://github.com/contiv/volplugin/pull/209#discussion_r59052811"},"pull_request":{"href":"https://api.github.com/repos/contiv/volplugin/pulls/209"}}},"pull_request":{"url":"https://api.github.com/repos/contiv/volplugin/pulls/209","id":65086462,"html_url":"https://github.com/contiv/volplugin/pull/209","diff_url":"https://github.com/contiv/volplugin/pull/209.diff","patch_url":"https://github.com/contiv/volplugin/pull/209.patch","issue_url":"https://api.github.com/repos/contiv/volplugin/issues/209","number":209,"state":"open","locked":false,"title":"Runtime configuration 4","user":{"login":"erikh","id":18923,"avatar_url":"https://avatars.githubusercontent.com/u/18923?v=3","gravatar_id":"","url":"https://api.github.com/users/erikh","html_url":"https://github.com/erikh","followers_url":"https://api.github.com/users/erikh/followers","following_url":"https://api.github.com/users/erikh/following{/other_user}","gists_url":"https://api.github.com/users/erikh/gists{/gist_id}","starred_url":"https://api.github.com/users/erikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikh/subscriptions","organizations_url":"https://api.github.com/users/erikh/orgs","repos_url":"https://api.github.com/users/erikh/repos","events_url":"https://api.github.com/users/erikh/events{/privacy}","received_events_url":"https://api.github.com/users/erikh/received_events","type":"User","site_admin":false},"body":"The biggest change here is that double-creates will fail if coming from volcli (docker will swallow the create for us in the `docker volume create` case). Additionally, I have re-integrated volume create flags, so that you can set up initial parameters for the filesystem, etc.","created_at":"2016-04-04T00:46:23Z","updated_at":"2016-04-08T16:33:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"06477ceb8b07951e2e3999da02e7ab5a020c7df2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/contiv/volplugin/pulls/209/commits","review_comments_url":"https://api.github.com/repos/contiv/volplugin/pulls/209/comments","review_comment_url":"https://api.github.com/repos/contiv/volplugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/contiv/volplugin/issues/209/comments","statuses_url":"https://api.github.com/repos/contiv/volplugin/statuses/4f0f2ba51464c689b1582852c36d55d700808f4b","head":{"label":"erikh:runtime-configuration-4","ref":"runtime-configuration-4","sha":"4f0f2ba51464c689b1582852c36d55d700808f4b","user":{"login":"erikh","id":18923,"avatar_url":"https://avatars.githubusercontent.com/u/18923?v=3","gravatar_id":"","url":"https://api.github.com/users/erikh","html_url":"https://github.com/erikh","followers_url":"https://api.github.com/users/erikh/followers","following_url":"https://api.github.com/users/erikh/following{/other_user}","gists_url":"https://api.github.com/users/erikh/gists{/gist_id}","starred_url":"https://api.github.com/users/erikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikh/subscriptions","organizations_url":"https://api.github.com/users/erikh/orgs","repos_url":"https://api.github.com/users/erikh/repos","events_url":"https://api.github.com/users/erikh/events{/privacy}","received_events_url":"https://api.github.com/users/erikh/received_events","type":"User","site_admin":false},"repo":{"id":44489688,"name":"volplugin","full_name":"erikh/volplugin","owner":{"login":"erikh","id":18923,"avatar_url":"https://avatars.githubusercontent.com/u/18923?v=3","gravatar_id":"","url":"https://api.github.com/users/erikh","html_url":"https://github.com/erikh","followers_url":"https://api.github.com/users/erikh/followers","following_url":"https://api.github.com/users/erikh/following{/other_user}","gists_url":"https://api.github.com/users/erikh/gists{/gist_id}","starred_url":"https://api.github.com/users/erikh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikh/subscriptions","organizations_url":"https://api.github.com/users/erikh/orgs","repos_url":"https://api.github.com/users/erikh/repos","events_url":"https://api.github.com/users/erikh/events{/privacy}","received_events_url":"https://api.github.com/users/erikh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/erikh/volplugin","description":"Ceph volume plugin for Docker","fork":true,"url":"https://api.github.com/repos/erikh/volplugin","forks_url":"https://api.github.com/repos/erikh/volplugin/forks","keys_url":"https://api.github.com/repos/erikh/volplugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erikh/volplugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erikh/volplugin/teams","hooks_url":"https://api.github.com/repos/erikh/volplugin/hooks","issue_events_url":"https://api.github.com/repos/erikh/volplugin/issues/events{/number}","events_url":"https://api.github.com/repos/erikh/volplugin/events","assignees_url":"https://api.github.com/repos/erikh/volplugin/assignees{/user}","branches_url":"https://api.github.com/repos/erikh/volplugin/branches{/branch}","tags_url":"https://api.github.com/repos/erikh/volplugin/tags","blobs_url":"https://api.github.com/repos/erikh/volplugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erikh/volplugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erikh/volplugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/erikh/volplugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erikh/volplugin/statuses/{sha}","languages_url":"https://api.github.com/repos/erikh/volplugin/languages","stargazers_url":"https://api.github.com/repos/erikh/volplugin/stargazers","contributors_url":"https://api.github.com/repos/erikh/volplugin/contributors","subscribers_url":"https://api.github.com/repos/erikh/volplugin/subscribers","subscription_url":"https://api.github.com/repos/erikh/volplugin/subscription","commits_url":"https://api.github.com/repos/erikh/volplugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/erikh/volplugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/erikh/volplugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/erikh/volplugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/erikh/volplugin/contents/{+path}","compare_url":"https://api.github.com/repos/erikh/volplugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erikh/volplugin/merges","archive_url":"https://api.github.com/repos/erikh/volplugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erikh/volplugin/downloads","issues_url":"https://api.github.com/repos/erikh/volplugin/issues{/number}","pulls_url":"https://api.github.com/repos/erikh/volplugin/pulls{/number}","milestones_url":"https://api.github.com/repos/erikh/volplugin/milestones{/number}","notifications_url":"https://api.github.com/repos/erikh/volplugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erikh/volplugin/labels{/name}","releases_url":"https://api.github.com/repos/erikh/volplugin/releases{/id}","deployments_url":"https://api.github.com/repos/erikh/volplugin/deployments","created_at":"2015-10-18T18:03:16Z","updated_at":"2015-10-18T18:03:16Z","pushed_at":"2016-04-07T21:34:35Z","git_url":"git://github.com/erikh/volplugin.git","ssh_url":"git@github.com:erikh/volplugin.git","clone_url":"https://github.com/erikh/volplugin.git","svn_url":"https://github.com/erikh/volplugin","homepage":null,"size":2638,"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":"contiv:master","ref":"master","sha":"9cbdf5c432d2cae7ecf8ca8625953e7a37cd96d5","user":{"login":"contiv","id":10272443,"avatar_url":"https://avatars.githubusercontent.com/u/10272443?v=3","gravatar_id":"","url":"https://api.github.com/users/contiv","html_url":"https://github.com/contiv","followers_url":"https://api.github.com/users/contiv/followers","following_url":"https://api.github.com/users/contiv/following{/other_user}","gists_url":"https://api.github.com/users/contiv/gists{/gist_id}","starred_url":"https://api.github.com/users/contiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contiv/subscriptions","organizations_url":"https://api.github.com/users/contiv/orgs","repos_url":"https://api.github.com/users/contiv/repos","events_url":"https://api.github.com/users/contiv/events{/privacy}","received_events_url":"https://api.github.com/users/contiv/received_events","type":"Organization","site_admin":false},"repo":{"id":38460040,"name":"volplugin","full_name":"contiv/volplugin","owner":{"login":"contiv","id":10272443,"avatar_url":"https://avatars.githubusercontent.com/u/10272443?v=3","gravatar_id":"","url":"https://api.github.com/users/contiv","html_url":"https://github.com/contiv","followers_url":"https://api.github.com/users/contiv/followers","following_url":"https://api.github.com/users/contiv/following{/other_user}","gists_url":"https://api.github.com/users/contiv/gists{/gist_id}","starred_url":"https://api.github.com/users/contiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contiv/subscriptions","organizations_url":"https://api.github.com/users/contiv/orgs","repos_url":"https://api.github.com/users/contiv/repos","events_url":"https://api.github.com/users/contiv/events{/privacy}","received_events_url":"https://api.github.com/users/contiv/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/contiv/volplugin","description":"Policy backed Clustered Storage (via Ceph) for Docker","fork":false,"url":"https://api.github.com/repos/contiv/volplugin","forks_url":"https://api.github.com/repos/contiv/volplugin/forks","keys_url":"https://api.github.com/repos/contiv/volplugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/contiv/volplugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/contiv/volplugin/teams","hooks_url":"https://api.github.com/repos/contiv/volplugin/hooks","issue_events_url":"https://api.github.com/repos/contiv/volplugin/issues/events{/number}","events_url":"https://api.github.com/repos/contiv/volplugin/events","assignees_url":"https://api.github.com/repos/contiv/volplugin/assignees{/user}","branches_url":"https://api.github.com/repos/contiv/volplugin/branches{/branch}","tags_url":"https://api.github.com/repos/contiv/volplugin/tags","blobs_url":"https://api.github.com/repos/contiv/volplugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/contiv/volplugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/contiv/volplugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/contiv/volplugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/contiv/volplugin/statuses/{sha}","languages_url":"https://api.github.com/repos/contiv/volplugin/languages","stargazers_url":"https://api.github.com/repos/contiv/volplugin/stargazers","contributors_url":"https://api.github.com/repos/contiv/volplugin/contributors","subscribers_url":"https://api.github.com/repos/contiv/volplugin/subscribers","subscription_url":"https://api.github.com/repos/contiv/volplugin/subscription","commits_url":"https://api.github.com/repos/contiv/volplugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/contiv/volplugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/contiv/volplugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/contiv/volplugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/contiv/volplugin/contents/{+path}","compare_url":"https://api.github.com/repos/contiv/volplugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/contiv/volplugin/merges","archive_url":"https://api.github.com/repos/contiv/volplugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/contiv/volplugin/downloads","issues_url":"https://api.github.com/repos/contiv/volplugin/issues{/number}","pulls_url":"https://api.github.com/repos/contiv/volplugin/pulls{/number}","milestones_url":"https://api.github.com/repos/contiv/volplugin/milestones{/number}","notifications_url":"https://api.github.com/repos/contiv/volplugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/contiv/volplugin/labels{/name}","releases_url":"https://api.github.com/repos/contiv/volplugin/releases{/id}","deployments_url":"https://api.github.com/repos/contiv/volplugin/deployments","created_at":"2015-07-02T22:31:53Z","updated_at":"2016-03-31T08:15:08Z","pushed_at":"2016-04-07T21:13:08Z","git_url":"git://github.com/contiv/volplugin.git","ssh_url":"git@github.com:contiv/volplugin.git","clone_url":"https://github.com/contiv/volplugin.git","svn_url":"https://github.com/contiv/volplugin","homepage":"http://docs.contiv.io","size":2537,"stargazers_count":86,"watchers_count":86,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":13,"forks":17,"open_issues":13,"watchers":86,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/contiv/volplugin/pulls/209"},"html":{"href":"https://github.com/contiv/volplugin/pull/209"},"issue":{"href":"https://api.github.com/repos/contiv/volplugin/issues/209"},"comments":{"href":"https://api.github.com/repos/contiv/volplugin/issues/209/comments"},"review_comments":{"href":"https://api.github.com/repos/contiv/volplugin/pulls/209/comments"},"review_comment":{"href":"https://api.github.com/repos/contiv/volplugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/contiv/volplugin/pulls/209/commits"},"statuses":{"href":"https://api.github.com/repos/contiv/volplugin/statuses/4f0f2ba51464c689b1582852c36d55d700808f4b"}}}}