{"action":"created","comment":{"url":"https://api.github.com/repos/docker/notary/pulls/comments/59795238","id":59795238,"diff_hunk":"@@ -61,25 +63,44 @@ func grpcTLS(configuration *viper.Viper) (*tls.Config, error) {\n }\n \n // parses the configuration and returns a backing store for the TUF files\n-func getStore(configuration *viper.Viper, allowedBackends []string, hRegister healthRegister) (\n+func getStore(configuration *viper.Viper, hRegister healthRegister) (\n \tstorage.MetaStore, error) {\n+\tvar (\n+\t\tstore storage.MetaStore\n+\t\terr   error\n+\t)\n+\tbackend := configuration.GetString(\"storage.backend\")\n+\tlogrus.Infof(\"Using %s backend\", backend)\n \n-\tstoreConfig, err := utils.ParseStorage(configuration, allowedBackends)\n-\tif err != nil {\n-\t\treturn nil, err\n-\t}\n-\tlogrus.Infof(\"Using %s backend\", storeConfig.Backend)\n-\n-\tif storeConfig.Backend == utils.MemoryBackend {\n+\tswitch backend {\n+\tcase notary.MemoryBackend:\n \t\treturn storage.NewMemStorage(), nil\n+\tcase notary.MySQLBackend, notary.SQLiteBackend:\n+\t\tstoreConfig, err := utils.ParseSQLStorage(configuration)\n+\t\tif err != nil {\n+\t\t\treturn nil, err\n+\t\t}\n+\t\ts, err := storage.NewSQLStorage(storeConfig.Backend, storeConfig.Source)\n+\t\tstore = *storage.NewTUFMetaStorage(s)\n+\t\thRegister(\"DB operational\", s.CheckHealth, time.Second*60)\n+\tcase notary.RethinkDBBackend:\n+\t\tvar sess *gorethink.Session\n+\t\tstoreConfig, err := utils.ParseRethinkDBStorage(configuration)\n+\t\tif err != nil {\n+\t\t\treturn nil, err\n+\t\t}\n+\t\tsess, err = rethinkdb.Connection(storeConfig.CA, storeConfig.Source)","path":"cmd/notary-server/config.go","position":54,"original_position":54,"commit_id":"75b62003c8f032d620159c790b5eb92fd6627741","original_commit_id":"75b62003c8f032d620159c790b5eb92fd6627741","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":"Can we add a negative test for what happens if we can't connect (tls cert doesn't exist, or can't connect to server)?","created_at":"2016-04-14T21:29:32Z","updated_at":"2016-04-14T21:29:32Z","html_url":"https://github.com/docker/notary/pull/647#discussion_r59795238","pull_request_url":"https://api.github.com/repos/docker/notary/pulls/647","_links":{"self":{"href":"https://api.github.com/repos/docker/notary/pulls/comments/59795238"},"html":{"href":"https://github.com/docker/notary/pull/647#discussion_r59795238"},"pull_request":{"href":"https://api.github.com/repos/docker/notary/pulls/647"}}},"pull_request":{"url":"https://api.github.com/repos/docker/notary/pulls/647","id":63941556,"html_url":"https://github.com/docker/notary/pull/647","diff_url":"https://github.com/docker/notary/pull/647.diff","patch_url":"https://github.com/docker/notary/pull/647.patch","issue_url":"https://api.github.com/repos/docker/notary/issues/647","number":647,"state":"open","locked":false,"title":"Rethinkdb support for server+signer","user":{"login":"endophage","id":1302091,"avatar_url":"https://avatars.githubusercontent.com/u/1302091?v=3","gravatar_id":"","url":"https://api.github.com/users/endophage","html_url":"https://github.com/endophage","followers_url":"https://api.github.com/users/endophage/followers","following_url":"https://api.github.com/users/endophage/following{/other_user}","gists_url":"https://api.github.com/users/endophage/gists{/gist_id}","starred_url":"https://api.github.com/users/endophage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endophage/subscriptions","organizations_url":"https://api.github.com/users/endophage/orgs","repos_url":"https://api.github.com/users/endophage/repos","events_url":"https://api.github.com/users/endophage/events{/privacy}","received_events_url":"https://api.github.com/users/endophage/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-23T19:45:07Z","updated_at":"2016-04-14T21:29:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"78adcb84d25f93da8ade0e2a3be1d20e954cfdb5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/notary/pulls/647/commits","review_comments_url":"https://api.github.com/repos/docker/notary/pulls/647/comments","review_comment_url":"https://api.github.com/repos/docker/notary/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/notary/issues/647/comments","statuses_url":"https://api.github.com/repos/docker/notary/statuses/75b62003c8f032d620159c790b5eb92fd6627741","head":{"label":"docker:rethinkdb","ref":"rethinkdb","sha":"75b62003c8f032d620159c790b5eb92fd6627741","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":37743436,"name":"notary","full_name":"docker/notary","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/notary","description":"Notary is a Docker project that allows anyone to have trust over arbitrary collections of data","fork":false,"url":"https://api.github.com/repos/docker/notary","forks_url":"https://api.github.com/repos/docker/notary/forks","keys_url":"https://api.github.com/repos/docker/notary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/notary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/notary/teams","hooks_url":"https://api.github.com/repos/docker/notary/hooks","issue_events_url":"https://api.github.com/repos/docker/notary/issues/events{/number}","events_url":"https://api.github.com/repos/docker/notary/events","assignees_url":"https://api.github.com/repos/docker/notary/assignees{/user}","branches_url":"https://api.github.com/repos/docker/notary/branches{/branch}","tags_url":"https://api.github.com/repos/docker/notary/tags","blobs_url":"https://api.github.com/repos/docker/notary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/notary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/notary/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/notary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/notary/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/notary/languages","stargazers_url":"https://api.github.com/repos/docker/notary/stargazers","contributors_url":"https://api.github.com/repos/docker/notary/contributors","subscribers_url":"https://api.github.com/repos/docker/notary/subscribers","subscription_url":"https://api.github.com/repos/docker/notary/subscription","commits_url":"https://api.github.com/repos/docker/notary/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/notary/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/notary/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/notary/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/notary/contents/{+path}","compare_url":"https://api.github.com/repos/docker/notary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/notary/merges","archive_url":"https://api.github.com/repos/docker/notary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/notary/downloads","issues_url":"https://api.github.com/repos/docker/notary/issues{/number}","pulls_url":"https://api.github.com/repos/docker/notary/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/notary/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/notary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/notary/labels{/name}","releases_url":"https://api.github.com/repos/docker/notary/releases{/id}","deployments_url":"https://api.github.com/repos/docker/notary/deployments","created_at":"2015-06-19T20:07:53Z","updated_at":"2016-04-14T07:25:33Z","pushed_at":"2016-04-14T21:12:30Z","git_url":"git://github.com/docker/notary.git","ssh_url":"git@github.com:docker/notary.git","clone_url":"https://github.com/docker/notary.git","svn_url":"https://github.com/docker/notary","homepage":"https://docker.com","size":29145,"stargazers_count":606,"watchers_count":606,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":92,"forks":81,"open_issues":92,"watchers":606,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"2968fa74073856da15a19fce6775862e39d3b644","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":37743436,"name":"notary","full_name":"docker/notary","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/notary","description":"Notary is a Docker project that allows anyone to have trust over arbitrary collections of data","fork":false,"url":"https://api.github.com/repos/docker/notary","forks_url":"https://api.github.com/repos/docker/notary/forks","keys_url":"https://api.github.com/repos/docker/notary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/notary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/notary/teams","hooks_url":"https://api.github.com/repos/docker/notary/hooks","issue_events_url":"https://api.github.com/repos/docker/notary/issues/events{/number}","events_url":"https://api.github.com/repos/docker/notary/events","assignees_url":"https://api.github.com/repos/docker/notary/assignees{/user}","branches_url":"https://api.github.com/repos/docker/notary/branches{/branch}","tags_url":"https://api.github.com/repos/docker/notary/tags","blobs_url":"https://api.github.com/repos/docker/notary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/notary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/notary/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/notary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/notary/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/notary/languages","stargazers_url":"https://api.github.com/repos/docker/notary/stargazers","contributors_url":"https://api.github.com/repos/docker/notary/contributors","subscribers_url":"https://api.github.com/repos/docker/notary/subscribers","subscription_url":"https://api.github.com/repos/docker/notary/subscription","commits_url":"https://api.github.com/repos/docker/notary/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/notary/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/notary/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/notary/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/notary/contents/{+path}","compare_url":"https://api.github.com/repos/docker/notary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/notary/merges","archive_url":"https://api.github.com/repos/docker/notary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/notary/downloads","issues_url":"https://api.github.com/repos/docker/notary/issues{/number}","pulls_url":"https://api.github.com/repos/docker/notary/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/notary/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/notary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/notary/labels{/name}","releases_url":"https://api.github.com/repos/docker/notary/releases{/id}","deployments_url":"https://api.github.com/repos/docker/notary/deployments","created_at":"2015-06-19T20:07:53Z","updated_at":"2016-04-14T07:25:33Z","pushed_at":"2016-04-14T21:12:30Z","git_url":"git://github.com/docker/notary.git","ssh_url":"git@github.com:docker/notary.git","clone_url":"https://github.com/docker/notary.git","svn_url":"https://github.com/docker/notary","homepage":"https://docker.com","size":29145,"stargazers_count":606,"watchers_count":606,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":92,"forks":81,"open_issues":92,"watchers":606,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/notary/pulls/647"},"html":{"href":"https://github.com/docker/notary/pull/647"},"issue":{"href":"https://api.github.com/repos/docker/notary/issues/647"},"comments":{"href":"https://api.github.com/repos/docker/notary/issues/647/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/notary/pulls/647/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/notary/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/notary/pulls/647/commits"},"statuses":{"href":"https://api.github.com/repos/docker/notary/statuses/75b62003c8f032d620159c790b5eb92fd6627741"}}}}