{"action":"created","comment":{"url":"https://api.github.com/repos/docker/swarmkit/pulls/comments/85218251","pull_request_review_id":5946511,"id":85218251,"diff_hunk":"@@ -209,23 +200,56 @@ func (rca *RootCA) RequestAndSaveNewCertificates(ctx context.Context, paths Cert\n \t\treturn nil, err\n \t}\n \n-\t// Ensure directory exists\n-\terr = os.MkdirAll(filepath.Dir(paths.Cert), 0755)\n+\tvar kekUpdate *KEKUpdate\n+\tfor i := 0; i < 5; i++ {\n+\t\tkekUpdate, err = rca.getKEKUpdate(ctx, X509Cert, tlsKeyPair, r)","path":"ca/certificates.go","position":75,"original_position":75,"commit_id":"07d297bbb3da449337833ddeda322df1eaf9330a","original_commit_id":"07d297bbb3da449337833ddeda322df1eaf9330a","user":{"login":"cyli","id":223200,"avatar_url":"https://avatars.githubusercontent.com/u/223200?v=3","gravatar_id":"","url":"https://api.github.com/users/cyli","html_url":"https://github.com/cyli","followers_url":"https://api.github.com/users/cyli/followers","following_url":"https://api.github.com/users/cyli/following{/other_user}","gists_url":"https://api.github.com/users/cyli/gists{/gist_id}","starred_url":"https://api.github.com/users/cyli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyli/subscriptions","organizations_url":"https://api.github.com/users/cyli/orgs","repos_url":"https://api.github.com/users/cyli/repos","events_url":"https://api.github.com/users/cyli/events{/privacy}","received_events_url":"https://api.github.com/users/cyli/received_events","type":"User","site_admin":false},"body":"This is similar to the loop for making the CSR request.  This particular function will give up if it fails.  The continuous retry occurs in `RenewTLSConfig`, which monitors the expiry and will keep retrying if it's getting close to the expiry of the TLS key.\r\n\r\nYou do bring up a good point in that we don't keep retrying if we go from an unlocked cluster to a locked cluster, though.  Maybe that should be best effort only?","created_at":"2016-10-26T20:55:23Z","updated_at":"2016-10-26T20:55:23Z","html_url":"https://github.com/docker/swarmkit/pull/1598#discussion_r85218251","pull_request_url":"https://api.github.com/repos/docker/swarmkit/pulls/1598","_links":{"self":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/comments/85218251"},"html":{"href":"https://github.com/docker/swarmkit/pull/1598#discussion_r85218251"},"pull_request":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/1598"}}},"pull_request":{"url":"https://api.github.com/repos/docker/swarmkit/pulls/1598","id":87847128,"html_url":"https://github.com/docker/swarmkit/pull/1598","diff_url":"https://github.com/docker/swarmkit/pull/1598.diff","patch_url":"https://github.com/docker/swarmkit/pull/1598.patch","issue_url":"https://api.github.com/repos/docker/swarmkit/issues/1598","number":1598,"state":"open","locked":false,"title":"Wrapper+Encryption around the etcd wal and snap packages","user":{"login":"cyli","id":223200,"avatar_url":"https://avatars.githubusercontent.com/u/223200?v=3","gravatar_id":"","url":"https://api.github.com/users/cyli","html_url":"https://github.com/cyli","followers_url":"https://api.github.com/users/cyli/followers","following_url":"https://api.github.com/users/cyli/following{/other_user}","gists_url":"https://api.github.com/users/cyli/gists{/gist_id}","starred_url":"https://api.github.com/users/cyli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyli/subscriptions","organizations_url":"https://api.github.com/users/cyli/orgs","repos_url":"https://api.github.com/users/cyli/repos","events_url":"https://api.github.com/users/cyli/events{/privacy}","received_events_url":"https://api.github.com/users/cyli/received_events","type":"User","site_admin":false},"body":"An implementation of a wrapper that would implement the on-disk snapshot encryption and on-disk WAL encryption as described here:  https://docs.google.com/document/d/1YxMH2oIv-mtRcs1djRkm0ndLfiteo0UzBUFKYhLKYkQ/edit#.\r\n\r\nThis is going to rely on `raft.go` or `storage.go` to tell it whether something is encrypted, and with which algorithm.  For WALs, such information can be included in the metadata of the file, but no such metadata exists for snapshots.  Another option is to base this on the snapshot and WAL directory locations/names, or on a metadata file that lives alongside the raft store.\r\n\r\nThis wraps every data object in an `EncryptedRecord` object which specifies the nonce, the algorithm, etc.\r\n\r\n- [x] wrapping code\r\n- [x] sample encoder/decoder using nacl/secretbox\r\n- [x] use the wrapping code in all of the current raft storage code\r\n- [x] migrate existing snapshots and wals to wrapped snapshots and wals\r\n- ~~encryption key KDF using lock key and node ID~~ <-- we can just take the full key for now, this can be in a separate PR\r\n- [x] force snapshot whenever the encryption key changes ","created_at":"2016-10-04T07:53:06Z","updated_at":"2016-10-26T20:55:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9bdfc960159e6ea8b35718f4375c3745330285cc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/docker/swarmkit/pulls/1598/commits","review_comments_url":"https://api.github.com/repos/docker/swarmkit/pulls/1598/comments","review_comment_url":"https://api.github.com/repos/docker/swarmkit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/swarmkit/issues/1598/comments","statuses_url":"https://api.github.com/repos/docker/swarmkit/statuses/07d297bbb3da449337833ddeda322df1eaf9330a","head":{"label":"cyli:wal-snapshot-wrapper","ref":"wal-snapshot-wrapper","sha":"07d297bbb3da449337833ddeda322df1eaf9330a","user":{"login":"cyli","id":223200,"avatar_url":"https://avatars.githubusercontent.com/u/223200?v=3","gravatar_id":"","url":"https://api.github.com/users/cyli","html_url":"https://github.com/cyli","followers_url":"https://api.github.com/users/cyli/followers","following_url":"https://api.github.com/users/cyli/following{/other_user}","gists_url":"https://api.github.com/users/cyli/gists{/gist_id}","starred_url":"https://api.github.com/users/cyli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyli/subscriptions","organizations_url":"https://api.github.com/users/cyli/orgs","repos_url":"https://api.github.com/users/cyli/repos","events_url":"https://api.github.com/users/cyli/events{/privacy}","received_events_url":"https://api.github.com/users/cyli/received_events","type":"User","site_admin":false},"repo":{"id":66887622,"name":"swarmkit","full_name":"cyli/swarmkit","owner":{"login":"cyli","id":223200,"avatar_url":"https://avatars.githubusercontent.com/u/223200?v=3","gravatar_id":"","url":"https://api.github.com/users/cyli","html_url":"https://github.com/cyli","followers_url":"https://api.github.com/users/cyli/followers","following_url":"https://api.github.com/users/cyli/following{/other_user}","gists_url":"https://api.github.com/users/cyli/gists{/gist_id}","starred_url":"https://api.github.com/users/cyli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyli/subscriptions","organizations_url":"https://api.github.com/users/cyli/orgs","repos_url":"https://api.github.com/users/cyli/repos","events_url":"https://api.github.com/users/cyli/events{/privacy}","received_events_url":"https://api.github.com/users/cyli/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cyli/swarmkit","description":"A toolkit for orchestrating distributed systems at any scale. It includes primitives for node discovery, raft-based consensus, task scheduling and more.","fork":true,"url":"https://api.github.com/repos/cyli/swarmkit","forks_url":"https://api.github.com/repos/cyli/swarmkit/forks","keys_url":"https://api.github.com/repos/cyli/swarmkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cyli/swarmkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cyli/swarmkit/teams","hooks_url":"https://api.github.com/repos/cyli/swarmkit/hooks","issue_events_url":"https://api.github.com/repos/cyli/swarmkit/issues/events{/number}","events_url":"https://api.github.com/repos/cyli/swarmkit/events","assignees_url":"https://api.github.com/repos/cyli/swarmkit/assignees{/user}","branches_url":"https://api.github.com/repos/cyli/swarmkit/branches{/branch}","tags_url":"https://api.github.com/repos/cyli/swarmkit/tags","blobs_url":"https://api.github.com/repos/cyli/swarmkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cyli/swarmkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cyli/swarmkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/cyli/swarmkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cyli/swarmkit/statuses/{sha}","languages_url":"https://api.github.com/repos/cyli/swarmkit/languages","stargazers_url":"https://api.github.com/repos/cyli/swarmkit/stargazers","contributors_url":"https://api.github.com/repos/cyli/swarmkit/contributors","subscribers_url":"https://api.github.com/repos/cyli/swarmkit/subscribers","subscription_url":"https://api.github.com/repos/cyli/swarmkit/subscription","commits_url":"https://api.github.com/repos/cyli/swarmkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/cyli/swarmkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/cyli/swarmkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/cyli/swarmkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/cyli/swarmkit/contents/{+path}","compare_url":"https://api.github.com/repos/cyli/swarmkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cyli/swarmkit/merges","archive_url":"https://api.github.com/repos/cyli/swarmkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cyli/swarmkit/downloads","issues_url":"https://api.github.com/repos/cyli/swarmkit/issues{/number}","pulls_url":"https://api.github.com/repos/cyli/swarmkit/pulls{/number}","milestones_url":"https://api.github.com/repos/cyli/swarmkit/milestones{/number}","notifications_url":"https://api.github.com/repos/cyli/swarmkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cyli/swarmkit/labels{/name}","releases_url":"https://api.github.com/repos/cyli/swarmkit/releases{/id}","deployments_url":"https://api.github.com/repos/cyli/swarmkit/deployments","created_at":"2016-08-29T23:13:03Z","updated_at":"2016-08-29T23:13:05Z","pushed_at":"2016-10-26T02:40:49Z","git_url":"git://github.com/cyli/swarmkit.git","ssh_url":"git@github.com:cyli/swarmkit.git","clone_url":"https://github.com/cyli/swarmkit.git","svn_url":"https://github.com/cyli/swarmkit","homepage":"","size":44376,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"docker:master","ref":"master","sha":"2ee7ad7c2ff0bb1335d01a39fd140ee8f961f45b","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":51556828,"name":"swarmkit","full_name":"docker/swarmkit","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/swarmkit","description":"A toolkit for orchestrating distributed systems at any scale. It includes primitives for node discovery, raft-based consensus, task scheduling and more.","fork":false,"url":"https://api.github.com/repos/docker/swarmkit","forks_url":"https://api.github.com/repos/docker/swarmkit/forks","keys_url":"https://api.github.com/repos/docker/swarmkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/swarmkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/swarmkit/teams","hooks_url":"https://api.github.com/repos/docker/swarmkit/hooks","issue_events_url":"https://api.github.com/repos/docker/swarmkit/issues/events{/number}","events_url":"https://api.github.com/repos/docker/swarmkit/events","assignees_url":"https://api.github.com/repos/docker/swarmkit/assignees{/user}","branches_url":"https://api.github.com/repos/docker/swarmkit/branches{/branch}","tags_url":"https://api.github.com/repos/docker/swarmkit/tags","blobs_url":"https://api.github.com/repos/docker/swarmkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/swarmkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/swarmkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/swarmkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/swarmkit/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/swarmkit/languages","stargazers_url":"https://api.github.com/repos/docker/swarmkit/stargazers","contributors_url":"https://api.github.com/repos/docker/swarmkit/contributors","subscribers_url":"https://api.github.com/repos/docker/swarmkit/subscribers","subscription_url":"https://api.github.com/repos/docker/swarmkit/subscription","commits_url":"https://api.github.com/repos/docker/swarmkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/swarmkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/swarmkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/swarmkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/swarmkit/contents/{+path}","compare_url":"https://api.github.com/repos/docker/swarmkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/swarmkit/merges","archive_url":"https://api.github.com/repos/docker/swarmkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/swarmkit/downloads","issues_url":"https://api.github.com/repos/docker/swarmkit/issues{/number}","pulls_url":"https://api.github.com/repos/docker/swarmkit/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/swarmkit/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/swarmkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/swarmkit/labels{/name}","releases_url":"https://api.github.com/repos/docker/swarmkit/releases{/id}","deployments_url":"https://api.github.com/repos/docker/swarmkit/deployments","created_at":"2016-02-12T00:02:15Z","updated_at":"2016-10-26T12:27:40Z","pushed_at":"2016-10-26T20:37:55Z","git_url":"git://github.com/docker/swarmkit.git","ssh_url":"git@github.com:docker/swarmkit.git","clone_url":"https://github.com/docker/swarmkit.git","svn_url":"https://github.com/docker/swarmkit","homepage":"","size":22446,"stargazers_count":1006,"watchers_count":1006,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":199,"mirror_url":null,"open_issues_count":178,"forks":199,"open_issues":178,"watchers":1006,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/1598"},"html":{"href":"https://github.com/docker/swarmkit/pull/1598"},"issue":{"href":"https://api.github.com/repos/docker/swarmkit/issues/1598"},"comments":{"href":"https://api.github.com/repos/docker/swarmkit/issues/1598/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/1598/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/swarmkit/pulls/1598/commits"},"statuses":{"href":"https://api.github.com/repos/docker/swarmkit/statuses/07d297bbb3da449337833ddeda322df1eaf9330a"}}}}
{"actor":{"display_login":"cyli"}}