{"action":"created","comment":{"url":"https://api.github.com/repos/rook/rook/pulls/comments/190924871","pull_request_review_id":123410447,"id":190924871,"diff_hunk":"@@ -190,18 +194,76 @@ func (d *Discover) createDiscoverDaemonSet(namespace, discoverImage string) erro\n func ListDevices(context *clusterd.Context, namespace, nodeName string) (map[string][]sys.LocalDisk, error) {\n \tvar devices map[string][]sys.LocalDisk\n \tlistOpts := metav1.ListOptions{LabelSelector: fmt.Sprintf(\"%s=%s\", k8sutil.AppAttr, discoverDaemon.AppName)}\n+\t// wait for device discovery configmaps\n+\tretryCount := 0\n+\tretryMax := 30\n+\tsleepTime := 5\n+\tfor {\n+\t\tretryCount++\n+\t\tif retryCount > retryMax {\n+\t\t\treturn devices, fmt.Errorf(\"exceeded max retry count\")\n+\t\t}\n+\n+\t\tif retryCount > 1 {\n+\t\t\t// only sleep after the first time\n+\t\t\t<-time.After(time.Duration(sleepTime) * time.Second)\n+\t\t}\n+\n+\t\tcms, err := context.Clientset.CoreV1().ConfigMaps(namespace).List(listOpts)\n+\t\tif err != nil {\n+\t\t\tlogger.Warningf(\"failed to list device configmaps: %v\", err)\n+\t\t\treturn devices, fmt.Errorf(\"failed to list device configmaps: %+v\", err)\n+\t\t}\n+\t\tif len(cms.Items) == 0 {\n+\t\t\tlogger.Infof(\"no configmap match, retry #%d\", retryCount)\n+\t\t\tcontinue\n+\t\t}\n+\t\tdevices = make(map[string][]sys.LocalDisk, len(cms.Items))\n+\t\tfor _, cm := range cms.Items {\n+\t\t\tnode := cm.ObjectMeta.Labels[discoverDaemon.NodeAttr]\n+\t\t\tif len(nodeName) > 0 && node != nodeName {\n+\t\t\t\tcontinue\n+\t\t\t}\n+\t\t\tdeviceJson := cm.Data[discoverDaemon.LocalDiskCMData]\n+\t\t\tlogger.Debugf(\"node %s, device %s\", node, deviceJson)\n+\n+\t\t\tif len(node) == 0 || len(deviceJson) == 0 {\n+\t\t\t\tcontinue\n+\t\t\t}\n+\t\t\tvar d []sys.LocalDisk\n+\t\t\terr = json.Unmarshal([]byte(deviceJson), &d)\n+\t\t\tif err != nil {\n+\t\t\t\tlogger.Warningf(\"failed to unmarshal %s\", deviceJson)\n+\t\t\t\tcontinue\n+\t\t\t}\n+\t\t\tdevices[node] = d\n+\t\t}\n+\t\tbreak","path":"pkg/operator/discover/discover.go","position":76,"original_position":66,"commit_id":"e04cf92ab12bf408332ee73ad16e578f2ef1a3f4","original_commit_id":"99e711eb367d98bb7642bbd47cf0e59375f9cda0","user":{"login":"rootfs","id":7062400,"avatar_url":"https://avatars0.githubusercontent.com/u/7062400?v=4","gravatar_id":"","url":"https://api.github.com/users/rootfs","html_url":"https://github.com/rootfs","followers_url":"https://api.github.com/users/rootfs/followers","following_url":"https://api.github.com/users/rootfs/following{/other_user}","gists_url":"https://api.github.com/users/rootfs/gists{/gist_id}","starred_url":"https://api.github.com/users/rootfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rootfs/subscriptions","organizations_url":"https://api.github.com/users/rootfs/orgs","repos_url":"https://api.github.com/users/rootfs/repos","events_url":"https://api.github.com/users/rootfs/events{/privacy}","received_events_url":"https://api.github.com/users/rootfs/received_events","type":"User","site_admin":false},"body":"the first iteration is to fill up the all the device map. Once the map is created (condition satisfied), then break the wait loop.","created_at":"2018-05-25T15:11:20Z","updated_at":"2018-05-25T15:11:20Z","html_url":"https://github.com/rook/rook/pull/1698#discussion_r190924871","pull_request_url":"https://api.github.com/repos/rook/rook/pulls/1698","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/rook/rook/pulls/comments/190924871"},"html":{"href":"https://github.com/rook/rook/pull/1698#discussion_r190924871"},"pull_request":{"href":"https://api.github.com/repos/rook/rook/pulls/1698"}},"in_reply_to_id":189207903},"pull_request":{"url":"https://api.github.com/repos/rook/rook/pulls/1698","id":185708957,"html_url":"https://github.com/rook/rook/pull/1698","diff_url":"https://github.com/rook/rook/pull/1698.diff","patch_url":"https://github.com/rook/rook/pull/1698.patch","issue_url":"https://api.github.com/repos/rook/rook/issues/1698","number":1698,"state":"open","locked":false,"title":"run ceph osd in its own pod","user":{"login":"rootfs","id":7062400,"avatar_url":"https://avatars0.githubusercontent.com/u/7062400?v=4","gravatar_id":"","url":"https://api.github.com/users/rootfs","html_url":"https://github.com/rootfs","followers_url":"https://api.github.com/users/rootfs/followers","following_url":"https://api.github.com/users/rootfs/following{/other_user}","gists_url":"https://api.github.com/users/rootfs/gists{/gist_id}","starred_url":"https://api.github.com/users/rootfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rootfs/subscriptions","organizations_url":"https://api.github.com/users/rootfs/orgs","repos_url":"https://api.github.com/users/rootfs/repos","events_url":"https://api.github.com/users/rootfs/events{/privacy}","received_events_url":"https://api.github.com/users/rootfs/received_events","type":"User","site_admin":false},"body":"Description of your changes:\r\n(this is a continuation of #1637)\r\nOnce device discovery is merged,  operator resolves devices before creating osds, creates job on each node to prepare osds, and then creates one replica set per osd.\r\n\r\nWhich issue is resolved by this Pull Request:\r\nResolves #1655 \r\n\r\nChecklist:\r\n- [ ] Documentation has been updated, if necessary.\r\n- [ ] Pending release notes updated with breaking and/or notable changes, if necessary.\r\n","created_at":"2018-05-03T13:01:33Z","updated_at":"2018-05-25T15:11:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6234019167098e6af9d97866bc2f50a68870c570","assignee":{"login":"travisn","id":1048514,"avatar_url":"https://avatars0.githubusercontent.com/u/1048514?v=4","gravatar_id":"","url":"https://api.github.com/users/travisn","html_url":"https://github.com/travisn","followers_url":"https://api.github.com/users/travisn/followers","following_url":"https://api.github.com/users/travisn/following{/other_user}","gists_url":"https://api.github.com/users/travisn/gists{/gist_id}","starred_url":"https://api.github.com/users/travisn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisn/subscriptions","organizations_url":"https://api.github.com/users/travisn/orgs","repos_url":"https://api.github.com/users/travisn/repos","events_url":"https://api.github.com/users/travisn/events{/privacy}","received_events_url":"https://api.github.com/users/travisn/received_events","type":"User","site_admin":false},"assignees":[{"login":"travisn","id":1048514,"avatar_url":"https://avatars0.githubusercontent.com/u/1048514?v=4","gravatar_id":"","url":"https://api.github.com/users/travisn","html_url":"https://github.com/travisn","followers_url":"https://api.github.com/users/travisn/followers","following_url":"https://api.github.com/users/travisn/following{/other_user}","gists_url":"https://api.github.com/users/travisn/gists{/gist_id}","starred_url":"https://api.github.com/users/travisn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisn/subscriptions","organizations_url":"https://api.github.com/users/travisn/orgs","repos_url":"https://api.github.com/users/travisn/repos","events_url":"https://api.github.com/users/travisn/events{/privacy}","received_events_url":"https://api.github.com/users/travisn/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/rook/rook/pulls/1698/commits","review_comments_url":"https://api.github.com/repos/rook/rook/pulls/1698/comments","review_comment_url":"https://api.github.com/repos/rook/rook/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rook/rook/issues/1698/comments","statuses_url":"https://api.github.com/repos/rook/rook/statuses/e04cf92ab12bf408332ee73ad16e578f2ef1a3f4","head":{"label":"rootfs:osd-per-pod-all","ref":"osd-per-pod-all","sha":"e04cf92ab12bf408332ee73ad16e578f2ef1a3f4","user":{"login":"rootfs","id":7062400,"avatar_url":"https://avatars0.githubusercontent.com/u/7062400?v=4","gravatar_id":"","url":"https://api.github.com/users/rootfs","html_url":"https://github.com/rootfs","followers_url":"https://api.github.com/users/rootfs/followers","following_url":"https://api.github.com/users/rootfs/following{/other_user}","gists_url":"https://api.github.com/users/rootfs/gists{/gist_id}","starred_url":"https://api.github.com/users/rootfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rootfs/subscriptions","organizations_url":"https://api.github.com/users/rootfs/orgs","repos_url":"https://api.github.com/users/rootfs/repos","events_url":"https://api.github.com/users/rootfs/events{/privacy}","received_events_url":"https://api.github.com/users/rootfs/received_events","type":"User","site_admin":false},"repo":{"id":122748056,"name":"rook","full_name":"rootfs/rook","owner":{"login":"rootfs","id":7062400,"avatar_url":"https://avatars0.githubusercontent.com/u/7062400?v=4","gravatar_id":"","url":"https://api.github.com/users/rootfs","html_url":"https://github.com/rootfs","followers_url":"https://api.github.com/users/rootfs/followers","following_url":"https://api.github.com/users/rootfs/following{/other_user}","gists_url":"https://api.github.com/users/rootfs/gists{/gist_id}","starred_url":"https://api.github.com/users/rootfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rootfs/subscriptions","organizations_url":"https://api.github.com/users/rootfs/orgs","repos_url":"https://api.github.com/users/rootfs/repos","events_url":"https://api.github.com/users/rootfs/events{/privacy}","received_events_url":"https://api.github.com/users/rootfs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rootfs/rook","description":"File, Block, and Object Storage Services for your Cloud-Native Environment","fork":true,"url":"https://api.github.com/repos/rootfs/rook","forks_url":"https://api.github.com/repos/rootfs/rook/forks","keys_url":"https://api.github.com/repos/rootfs/rook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rootfs/rook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rootfs/rook/teams","hooks_url":"https://api.github.com/repos/rootfs/rook/hooks","issue_events_url":"https://api.github.com/repos/rootfs/rook/issues/events{/number}","events_url":"https://api.github.com/repos/rootfs/rook/events","assignees_url":"https://api.github.com/repos/rootfs/rook/assignees{/user}","branches_url":"https://api.github.com/repos/rootfs/rook/branches{/branch}","tags_url":"https://api.github.com/repos/rootfs/rook/tags","blobs_url":"https://api.github.com/repos/rootfs/rook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rootfs/rook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rootfs/rook/git/refs{/sha}","trees_url":"https://api.github.com/repos/rootfs/rook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rootfs/rook/statuses/{sha}","languages_url":"https://api.github.com/repos/rootfs/rook/languages","stargazers_url":"https://api.github.com/repos/rootfs/rook/stargazers","contributors_url":"https://api.github.com/repos/rootfs/rook/contributors","subscribers_url":"https://api.github.com/repos/rootfs/rook/subscribers","subscription_url":"https://api.github.com/repos/rootfs/rook/subscription","commits_url":"https://api.github.com/repos/rootfs/rook/commits{/sha}","git_commits_url":"https://api.github.com/repos/rootfs/rook/git/commits{/sha}","comments_url":"https://api.github.com/repos/rootfs/rook/comments{/number}","issue_comment_url":"https://api.github.com/repos/rootfs/rook/issues/comments{/number}","contents_url":"https://api.github.com/repos/rootfs/rook/contents/{+path}","compare_url":"https://api.github.com/repos/rootfs/rook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rootfs/rook/merges","archive_url":"https://api.github.com/repos/rootfs/rook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rootfs/rook/downloads","issues_url":"https://api.github.com/repos/rootfs/rook/issues{/number}","pulls_url":"https://api.github.com/repos/rootfs/rook/pulls{/number}","milestones_url":"https://api.github.com/repos/rootfs/rook/milestones{/number}","notifications_url":"https://api.github.com/repos/rootfs/rook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rootfs/rook/labels{/name}","releases_url":"https://api.github.com/repos/rootfs/rook/releases{/id}","deployments_url":"https://api.github.com/repos/rootfs/rook/deployments","created_at":"2018-02-24T14:35:17Z","updated_at":"2018-02-24T14:35:21Z","pushed_at":"2018-05-24T19:57:52Z","git_url":"git://github.com/rootfs/rook.git","ssh_url":"git@github.com:rootfs/rook.git","clone_url":"https://github.com/rootfs/rook.git","svn_url":"https://github.com/rootfs/rook","homepage":"https://rook.io","size":5054,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rook:master","ref":"master","sha":"cf5b60561edf3339811740d3b1b5af7d6d88ed72","user":{"login":"rook","id":22860722,"avatar_url":"https://avatars1.githubusercontent.com/u/22860722?v=4","gravatar_id":"","url":"https://api.github.com/users/rook","html_url":"https://github.com/rook","followers_url":"https://api.github.com/users/rook/followers","following_url":"https://api.github.com/users/rook/following{/other_user}","gists_url":"https://api.github.com/users/rook/gists{/gist_id}","starred_url":"https://api.github.com/users/rook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rook/subscriptions","organizations_url":"https://api.github.com/users/rook/orgs","repos_url":"https://api.github.com/users/rook/repos","events_url":"https://api.github.com/users/rook/events{/privacy}","received_events_url":"https://api.github.com/users/rook/received_events","type":"Organization","site_admin":false},"repo":{"id":62921553,"name":"rook","full_name":"rook/rook","owner":{"login":"rook","id":22860722,"avatar_url":"https://avatars1.githubusercontent.com/u/22860722?v=4","gravatar_id":"","url":"https://api.github.com/users/rook","html_url":"https://github.com/rook","followers_url":"https://api.github.com/users/rook/followers","following_url":"https://api.github.com/users/rook/following{/other_user}","gists_url":"https://api.github.com/users/rook/gists{/gist_id}","starred_url":"https://api.github.com/users/rook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rook/subscriptions","organizations_url":"https://api.github.com/users/rook/orgs","repos_url":"https://api.github.com/users/rook/repos","events_url":"https://api.github.com/users/rook/events{/privacy}","received_events_url":"https://api.github.com/users/rook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rook/rook","description":"File, Block, and Object Storage Services for your Cloud-Native Environment","fork":false,"url":"https://api.github.com/repos/rook/rook","forks_url":"https://api.github.com/repos/rook/rook/forks","keys_url":"https://api.github.com/repos/rook/rook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rook/rook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rook/rook/teams","hooks_url":"https://api.github.com/repos/rook/rook/hooks","issue_events_url":"https://api.github.com/repos/rook/rook/issues/events{/number}","events_url":"https://api.github.com/repos/rook/rook/events","assignees_url":"https://api.github.com/repos/rook/rook/assignees{/user}","branches_url":"https://api.github.com/repos/rook/rook/branches{/branch}","tags_url":"https://api.github.com/repos/rook/rook/tags","blobs_url":"https://api.github.com/repos/rook/rook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rook/rook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rook/rook/git/refs{/sha}","trees_url":"https://api.github.com/repos/rook/rook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rook/rook/statuses/{sha}","languages_url":"https://api.github.com/repos/rook/rook/languages","stargazers_url":"https://api.github.com/repos/rook/rook/stargazers","contributors_url":"https://api.github.com/repos/rook/rook/contributors","subscribers_url":"https://api.github.com/repos/rook/rook/subscribers","subscription_url":"https://api.github.com/repos/rook/rook/subscription","commits_url":"https://api.github.com/repos/rook/rook/commits{/sha}","git_commits_url":"https://api.github.com/repos/rook/rook/git/commits{/sha}","comments_url":"https://api.github.com/repos/rook/rook/comments{/number}","issue_comment_url":"https://api.github.com/repos/rook/rook/issues/comments{/number}","contents_url":"https://api.github.com/repos/rook/rook/contents/{+path}","compare_url":"https://api.github.com/repos/rook/rook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rook/rook/merges","archive_url":"https://api.github.com/repos/rook/rook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rook/rook/downloads","issues_url":"https://api.github.com/repos/rook/rook/issues{/number}","pulls_url":"https://api.github.com/repos/rook/rook/pulls{/number}","milestones_url":"https://api.github.com/repos/rook/rook/milestones{/number}","notifications_url":"https://api.github.com/repos/rook/rook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rook/rook/labels{/name}","releases_url":"https://api.github.com/repos/rook/rook/releases{/id}","deployments_url":"https://api.github.com/repos/rook/rook/deployments","created_at":"2016-07-08T22:45:05Z","updated_at":"2018-05-25T15:10:43Z","pushed_at":"2018-05-25T15:10:39Z","git_url":"git://github.com/rook/rook.git","ssh_url":"git@github.com:rook/rook.git","clone_url":"https://github.com/rook/rook.git","svn_url":"https://github.com/rook/rook","homepage":"https://rook.io","size":5139,"stargazers_count":2851,"watchers_count":2851,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":313,"mirror_url":null,"archived":false,"open_issues_count":203,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":313,"open_issues":203,"watchers":2851,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rook/rook/pulls/1698"},"html":{"href":"https://github.com/rook/rook/pull/1698"},"issue":{"href":"https://api.github.com/repos/rook/rook/issues/1698"},"comments":{"href":"https://api.github.com/repos/rook/rook/issues/1698/comments"},"review_comments":{"href":"https://api.github.com/repos/rook/rook/pulls/1698/comments"},"review_comment":{"href":"https://api.github.com/repos/rook/rook/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rook/rook/pulls/1698/commits"},"statuses":{"href":"https://api.github.com/repos/rook/rook/statuses/e04cf92ab12bf408332ee73ad16e578f2ef1a3f4"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"rootfs"}}