{"action":"created","comment":{"url":"https://api.github.com/repos/rook/rook/pulls/comments/148146673","pull_request_review_id":73345528,"id":148146673,"diff_hunk":"@@ -0,0 +1,46 @@\n+/*\n+Copyright 2016 The Rook Authors. All rights reserved.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+\thttp://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+package main\n+\n+import (\n+\t\"fmt\"\n+\t\"io/ioutil\"\n+\t\"os\"\n+\t\"path\"\n+\t\"testing\"\n+\n+\t\"github.com/stretchr/testify/assert\"\n+)\n+\n+func TestCompareKeyring(t *testing.T) {\n+\tconfigDir, _ := ioutil.TempDir(\"\", \"\")\n+\tdefer os.RemoveAll(configDir)\n+\n+\tkeyring := \"mytestcomplicatedsecurekeyring\"\n+\tcontents := fmt.Sprintf(`\n+\t[mon.]\n+\t  key = %s\n+\t`, keyring)\n+\tdataPath := path.Join(configDir, \"data\")\n+\tkeyringPath := path.Join(dataPath, \"keyring\")\n+\terr := os.MkdirAll(dataPath, 0755)\n+\tassert.Nil(t, err)\n+\terr = ioutil.WriteFile(keyringPath, []byte(contents), 0644)\n+\tassert.Nil(t, err)\n+\n+\terr = compareMonSecret(keyring, configDir)","path":"cmd/rook/mon_test.go","position":44,"original_position":44,"commit_id":"e61f5c5dd12319c61245dc8d53c9355550cda33a","original_commit_id":"e61f5c5dd12319c61245dc8d53c9355550cda33a","user":{"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},"body":"hmm, negative test was intended","created_at":"2017-10-31T22:42:01Z","updated_at":"2017-10-31T22:42:09Z","html_url":"https://github.com/rook/rook/pull/1158#discussion_r148146673","pull_request_url":"https://api.github.com/repos/rook/rook/pulls/1158","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/rook/rook/pulls/comments/148146673"},"html":{"href":"https://github.com/rook/rook/pull/1158#discussion_r148146673"},"pull_request":{"href":"https://api.github.com/repos/rook/rook/pulls/1158"}},"in_reply_to_id":148142678},"pull_request":{"url":"https://api.github.com/repos/rook/rook/pulls/1158","id":149659210,"html_url":"https://github.com/rook/rook/pull/1158","diff_url":"https://github.com/rook/rook/pull/1158.diff","patch_url":"https://github.com/rook/rook/pull/1158.patch","issue_url":"https://api.github.com/repos/rook/rook/issues/1158","number":1158,"state":"open","locked":false,"title":"Set default dataDirHostPath to /var/lib/rook","user":{"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},"body":"To survive pod and node restarts, the config dir needs to be persisted to the host. As an interim change until we get the full solution on top of the local storage (#796), this change will by default set the `dataDirHostPath` to `/var/lib/rook` so the default configuration will allow for restarts. If `/var/lib/rook` is not valid for the host, the mons will fail to start and the cluster will not initialize. \r\n\r\nIf a test cluster is destroyed and a new one brought up in its place, the path on the host must be deleted. Otherwise, the new cluster will fail to start. The mon log will have an error such as the following and enter a crash backoff loop.\r\n```\r\nnew mon keyring does not match existing keyring in /var/lib/rook/rook-ceph-mon0/data/keyring\r\n```","created_at":"2017-10-30T23:03:53Z","updated_at":"2017-10-31T22:42:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ba6e39382b584d405ec253f4db20ab5f67e4853a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/rook/rook/pulls/1158/commits","review_comments_url":"https://api.github.com/repos/rook/rook/pulls/1158/comments","review_comment_url":"https://api.github.com/repos/rook/rook/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rook/rook/issues/1158/comments","statuses_url":"https://api.github.com/repos/rook/rook/statuses/e61f5c5dd12319c61245dc8d53c9355550cda33a","head":{"label":"travisn:default-datadir","ref":"default-datadir","sha":"e61f5c5dd12319c61245dc8d53c9355550cda33a","user":{"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},"repo":{"id":73165238,"name":"rook","full_name":"travisn/rook","owner":{"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},"private":false,"html_url":"https://github.com/travisn/rook","description":"Open, Universal, Cloud Native, Distributed Storage","fork":true,"url":"https://api.github.com/repos/travisn/rook","forks_url":"https://api.github.com/repos/travisn/rook/forks","keys_url":"https://api.github.com/repos/travisn/rook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/travisn/rook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/travisn/rook/teams","hooks_url":"https://api.github.com/repos/travisn/rook/hooks","issue_events_url":"https://api.github.com/repos/travisn/rook/issues/events{/number}","events_url":"https://api.github.com/repos/travisn/rook/events","assignees_url":"https://api.github.com/repos/travisn/rook/assignees{/user}","branches_url":"https://api.github.com/repos/travisn/rook/branches{/branch}","tags_url":"https://api.github.com/repos/travisn/rook/tags","blobs_url":"https://api.github.com/repos/travisn/rook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/travisn/rook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/travisn/rook/git/refs{/sha}","trees_url":"https://api.github.com/repos/travisn/rook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/travisn/rook/statuses/{sha}","languages_url":"https://api.github.com/repos/travisn/rook/languages","stargazers_url":"https://api.github.com/repos/travisn/rook/stargazers","contributors_url":"https://api.github.com/repos/travisn/rook/contributors","subscribers_url":"https://api.github.com/repos/travisn/rook/subscribers","subscription_url":"https://api.github.com/repos/travisn/rook/subscription","commits_url":"https://api.github.com/repos/travisn/rook/commits{/sha}","git_commits_url":"https://api.github.com/repos/travisn/rook/git/commits{/sha}","comments_url":"https://api.github.com/repos/travisn/rook/comments{/number}","issue_comment_url":"https://api.github.com/repos/travisn/rook/issues/comments{/number}","contents_url":"https://api.github.com/repos/travisn/rook/contents/{+path}","compare_url":"https://api.github.com/repos/travisn/rook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/travisn/rook/merges","archive_url":"https://api.github.com/repos/travisn/rook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/travisn/rook/downloads","issues_url":"https://api.github.com/repos/travisn/rook/issues{/number}","pulls_url":"https://api.github.com/repos/travisn/rook/pulls{/number}","milestones_url":"https://api.github.com/repos/travisn/rook/milestones{/number}","notifications_url":"https://api.github.com/repos/travisn/rook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/travisn/rook/labels{/name}","releases_url":"https://api.github.com/repos/travisn/rook/releases{/id}","deployments_url":"https://api.github.com/repos/travisn/rook/deployments","created_at":"2016-11-08T08:30:24Z","updated_at":"2016-11-08T08:30:25Z","pushed_at":"2017-10-31T22:34:25Z","git_url":"git://github.com/travisn/rook.git","ssh_url":"git@github.com:travisn/rook.git","clone_url":"https://github.com/travisn/rook.git","svn_url":"https://github.com/travisn/rook","homepage":"http://rook.io","size":3654,"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,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rook:master","ref":"master","sha":"7b206654f02db12fd0a2665bc20b149bb9bed39c","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":"2017-10-31T22:28:01Z","pushed_at":"2017-10-31T22:40:43Z","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":3651,"stargazers_count":1706,"watchers_count":1706,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":136,"mirror_url":null,"archived":false,"open_issues_count":125,"forks":136,"open_issues":125,"watchers":1706,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rook/rook/pulls/1158"},"html":{"href":"https://github.com/rook/rook/pull/1158"},"issue":{"href":"https://api.github.com/repos/rook/rook/issues/1158"},"comments":{"href":"https://api.github.com/repos/rook/rook/issues/1158/comments"},"review_comments":{"href":"https://api.github.com/repos/rook/rook/pulls/1158/comments"},"review_comment":{"href":"https://api.github.com/repos/rook/rook/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rook/rook/pulls/1158/commits"},"statuses":{"href":"https://api.github.com/repos/rook/rook/statuses/e61f5c5dd12319c61245dc8d53c9355550cda33a"}},"author_association":"OWNER"}}
{"actor":{"display_login":"travisn"}}