{"action":"created","comment":{"url":"https://api.github.com/repos/docker/distribution/pulls/comments/37584718","id":37584718,"diff_hunk":"@@ -159,33 +179,39 @@ func CheckStatus() map[string]string { // TODO(stevvooe) this needs a proper typ\n }\n \n // Register associates the checker with the provided name. We allow\n-// overwrites to a specific check status.\n-func Register(name string, check Checker) {\n-\tmutex.Lock()\n-\tdefer mutex.Unlock()\n-\t_, ok := registeredChecks[name]\n+// overwrites to a specific check status. registry may be nil to use the\n+// default registry.\n+func Register(registry *Registry, name string, check Checker) {","path":"health/health.go","position":62,"original_position":62,"commit_id":"ffd2a904510496674801b91fb6194ebf671fb3ef","original_commit_id":"ffd2a904510496674801b91fb6194ebf671fb3ef","user":{"login":"stevvooe","id":120601,"avatar_url":"https://avatars.githubusercontent.com/u/120601?v=3","gravatar_id":"","url":"https://api.github.com/users/stevvooe","html_url":"https://github.com/stevvooe","followers_url":"https://api.github.com/users/stevvooe/followers","following_url":"https://api.github.com/users/stevvooe/following{/other_user}","gists_url":"https://api.github.com/users/stevvooe/gists{/gist_id}","starred_url":"https://api.github.com/users/stevvooe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevvooe/subscriptions","organizations_url":"https://api.github.com/users/stevvooe/orgs","repos_url":"https://api.github.com/users/stevvooe/repos","events_url":"https://api.github.com/users/stevvooe/events{/privacy}","received_events_url":"https://api.github.com/users/stevvooe/received_events","type":"User","site_admin":false},"body":"Users should still call `health.Register`, which is the same as `health.DefaultRegistry.Register` without the first argument.","created_at":"2015-08-20T21:42:52Z","updated_at":"2015-08-20T21:42:52Z","html_url":"https://github.com/docker/distribution/pull/901#discussion_r37584718","pull_request_url":"https://api.github.com/repos/docker/distribution/pulls/901","_links":{"self":{"href":"https://api.github.com/repos/docker/distribution/pulls/comments/37584718"},"html":{"href":"https://github.com/docker/distribution/pull/901#discussion_r37584718"},"pull_request":{"href":"https://api.github.com/repos/docker/distribution/pulls/901"}}},"pull_request":{"url":"https://api.github.com/repos/docker/distribution/pulls/901","id":42843105,"html_url":"https://github.com/docker/distribution/pull/901","diff_url":"https://github.com/docker/distribution/pull/901.diff","patch_url":"https://github.com/docker/distribution/pull/901.patch","issue_url":"https://api.github.com/repos/docker/distribution/issues/901","number":901,"state":"open","locked":false,"title":"Add configurable file-existence and HTTP health checks","user":{"login":"aaronlehmann","id":10601430,"avatar_url":"https://avatars.githubusercontent.com/u/10601430?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronlehmann","html_url":"https://github.com/aaronlehmann","followers_url":"https://api.github.com/users/aaronlehmann/followers","following_url":"https://api.github.com/users/aaronlehmann/following{/other_user}","gists_url":"https://api.github.com/users/aaronlehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronlehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronlehmann/subscriptions","organizations_url":"https://api.github.com/users/aaronlehmann/orgs","repos_url":"https://api.github.com/users/aaronlehmann/repos","events_url":"https://api.github.com/users/aaronlehmann/events{/privacy}","received_events_url":"https://api.github.com/users/aaronlehmann/received_events","type":"User","site_admin":false},"body":"Add a section to the config file called \"health\". Within this section,\r\n\"filecheckers\" and \"httpcheckers\" list checks to run. Each check\r\nspecifies a file or URI, a time interval for the check, and a threshold\r\nspecifying how many times the check must fail to reach an unhealthy\r\nstate.\r\n\r\nDocument the new options in docs/configuration.md.\r\n\r\nAdd unit testing for both types of checkers. Add an UnregisterAll\r\nfunction in the health package to support the unit tests, and an\r\nUnregister function for consistency with Register.\r\n\r\nFix a string conversion problem in the health package's HTTP checker.\r\n\r\nFixes #271.","created_at":"2015-08-19T17:45:42Z","updated_at":"2015-08-20T21:42:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0e25c91b275dcf9a5bfc5a7d664a0db17852741","assignee":{"login":"aaronlehmann","id":10601430,"avatar_url":"https://avatars.githubusercontent.com/u/10601430?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronlehmann","html_url":"https://github.com/aaronlehmann","followers_url":"https://api.github.com/users/aaronlehmann/followers","following_url":"https://api.github.com/users/aaronlehmann/following{/other_user}","gists_url":"https://api.github.com/users/aaronlehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronlehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronlehmann/subscriptions","organizations_url":"https://api.github.com/users/aaronlehmann/orgs","repos_url":"https://api.github.com/users/aaronlehmann/repos","events_url":"https://api.github.com/users/aaronlehmann/events{/privacy}","received_events_url":"https://api.github.com/users/aaronlehmann/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/docker/distribution/milestones/9","html_url":"https://github.com/docker/distribution/milestones/Registry/2.2","labels_url":"https://api.github.com/repos/docker/distribution/milestones/9/labels","id":1026605,"number":9,"title":"Registry/2.2","description":"","creator":{"login":"stevvooe","id":120601,"avatar_url":"https://avatars.githubusercontent.com/u/120601?v=3","gravatar_id":"","url":"https://api.github.com/users/stevvooe","html_url":"https://github.com/stevvooe","followers_url":"https://api.github.com/users/stevvooe/followers","following_url":"https://api.github.com/users/stevvooe/following{/other_user}","gists_url":"https://api.github.com/users/stevvooe/gists{/gist_id}","starred_url":"https://api.github.com/users/stevvooe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevvooe/subscriptions","organizations_url":"https://api.github.com/users/stevvooe/orgs","repos_url":"https://api.github.com/users/stevvooe/repos","events_url":"https://api.github.com/users/stevvooe/events{/privacy}","received_events_url":"https://api.github.com/users/stevvooe/received_events","type":"User","site_admin":false},"open_issues":40,"closed_issues":22,"state":"open","created_at":"2015-03-18T04:28:58Z","updated_at":"2015-08-20T21:06:16Z","due_on":"2015-08-26T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/docker/distribution/pulls/901/commits","review_comments_url":"https://api.github.com/repos/docker/distribution/pulls/901/comments","review_comment_url":"https://api.github.com/repos/docker/distribution/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/distribution/issues/901/comments","statuses_url":"https://api.github.com/repos/docker/distribution/statuses/ffd2a904510496674801b91fb6194ebf671fb3ef","head":{"label":"aaronlehmann:configurable-health-checks","ref":"configurable-health-checks","sha":"ffd2a904510496674801b91fb6194ebf671fb3ef","user":{"login":"aaronlehmann","id":10601430,"avatar_url":"https://avatars.githubusercontent.com/u/10601430?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronlehmann","html_url":"https://github.com/aaronlehmann","followers_url":"https://api.github.com/users/aaronlehmann/followers","following_url":"https://api.github.com/users/aaronlehmann/following{/other_user}","gists_url":"https://api.github.com/users/aaronlehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronlehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronlehmann/subscriptions","organizations_url":"https://api.github.com/users/aaronlehmann/orgs","repos_url":"https://api.github.com/users/aaronlehmann/repos","events_url":"https://api.github.com/users/aaronlehmann/events{/privacy}","received_events_url":"https://api.github.com/users/aaronlehmann/received_events","type":"User","site_admin":false},"repo":{"id":38719418,"name":"distribution","full_name":"aaronlehmann/distribution","owner":{"login":"aaronlehmann","id":10601430,"avatar_url":"https://avatars.githubusercontent.com/u/10601430?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronlehmann","html_url":"https://github.com/aaronlehmann","followers_url":"https://api.github.com/users/aaronlehmann/followers","following_url":"https://api.github.com/users/aaronlehmann/following{/other_user}","gists_url":"https://api.github.com/users/aaronlehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronlehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronlehmann/subscriptions","organizations_url":"https://api.github.com/users/aaronlehmann/orgs","repos_url":"https://api.github.com/users/aaronlehmann/repos","events_url":"https://api.github.com/users/aaronlehmann/events{/privacy}","received_events_url":"https://api.github.com/users/aaronlehmann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aaronlehmann/distribution","description":"The Docker toolset to pack, ship, store, and deliver content","fork":true,"url":"https://api.github.com/repos/aaronlehmann/distribution","forks_url":"https://api.github.com/repos/aaronlehmann/distribution/forks","keys_url":"https://api.github.com/repos/aaronlehmann/distribution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aaronlehmann/distribution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aaronlehmann/distribution/teams","hooks_url":"https://api.github.com/repos/aaronlehmann/distribution/hooks","issue_events_url":"https://api.github.com/repos/aaronlehmann/distribution/issues/events{/number}","events_url":"https://api.github.com/repos/aaronlehmann/distribution/events","assignees_url":"https://api.github.com/repos/aaronlehmann/distribution/assignees{/user}","branches_url":"https://api.github.com/repos/aaronlehmann/distribution/branches{/branch}","tags_url":"https://api.github.com/repos/aaronlehmann/distribution/tags","blobs_url":"https://api.github.com/repos/aaronlehmann/distribution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aaronlehmann/distribution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aaronlehmann/distribution/git/refs{/sha}","trees_url":"https://api.github.com/repos/aaronlehmann/distribution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aaronlehmann/distribution/statuses/{sha}","languages_url":"https://api.github.com/repos/aaronlehmann/distribution/languages","stargazers_url":"https://api.github.com/repos/aaronlehmann/distribution/stargazers","contributors_url":"https://api.github.com/repos/aaronlehmann/distribution/contributors","subscribers_url":"https://api.github.com/repos/aaronlehmann/distribution/subscribers","subscription_url":"https://api.github.com/repos/aaronlehmann/distribution/subscription","commits_url":"https://api.github.com/repos/aaronlehmann/distribution/commits{/sha}","git_commits_url":"https://api.github.com/repos/aaronlehmann/distribution/git/commits{/sha}","comments_url":"https://api.github.com/repos/aaronlehmann/distribution/comments{/number}","issue_comment_url":"https://api.github.com/repos/aaronlehmann/distribution/issues/comments{/number}","contents_url":"https://api.github.com/repos/aaronlehmann/distribution/contents/{+path}","compare_url":"https://api.github.com/repos/aaronlehmann/distribution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aaronlehmann/distribution/merges","archive_url":"https://api.github.com/repos/aaronlehmann/distribution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aaronlehmann/distribution/downloads","issues_url":"https://api.github.com/repos/aaronlehmann/distribution/issues{/number}","pulls_url":"https://api.github.com/repos/aaronlehmann/distribution/pulls{/number}","milestones_url":"https://api.github.com/repos/aaronlehmann/distribution/milestones{/number}","notifications_url":"https://api.github.com/repos/aaronlehmann/distribution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aaronlehmann/distribution/labels{/name}","releases_url":"https://api.github.com/repos/aaronlehmann/distribution/releases{/id}","created_at":"2015-07-07T23:02:33Z","updated_at":"2015-07-07T23:02:34Z","pushed_at":"2015-08-20T20:59:18Z","git_url":"git://github.com/aaronlehmann/distribution.git","ssh_url":"git@github.com:aaronlehmann/distribution.git","clone_url":"https://github.com/aaronlehmann/distribution.git","svn_url":"https://github.com/aaronlehmann/distribution","homepage":null,"size":3531,"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":"docker:master","ref":"master","sha":"e4b93d1e6dc0c67c9d348ccbe32818d3d1174a86","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":28366058,"name":"distribution","full_name":"docker/distribution","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/distribution","description":"The Docker toolset to pack, ship, store, and deliver content","fork":false,"url":"https://api.github.com/repos/docker/distribution","forks_url":"https://api.github.com/repos/docker/distribution/forks","keys_url":"https://api.github.com/repos/docker/distribution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/distribution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/distribution/teams","hooks_url":"https://api.github.com/repos/docker/distribution/hooks","issue_events_url":"https://api.github.com/repos/docker/distribution/issues/events{/number}","events_url":"https://api.github.com/repos/docker/distribution/events","assignees_url":"https://api.github.com/repos/docker/distribution/assignees{/user}","branches_url":"https://api.github.com/repos/docker/distribution/branches{/branch}","tags_url":"https://api.github.com/repos/docker/distribution/tags","blobs_url":"https://api.github.com/repos/docker/distribution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/distribution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/distribution/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/distribution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/distribution/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/distribution/languages","stargazers_url":"https://api.github.com/repos/docker/distribution/stargazers","contributors_url":"https://api.github.com/repos/docker/distribution/contributors","subscribers_url":"https://api.github.com/repos/docker/distribution/subscribers","subscription_url":"https://api.github.com/repos/docker/distribution/subscription","commits_url":"https://api.github.com/repos/docker/distribution/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/distribution/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/distribution/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/distribution/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/distribution/contents/{+path}","compare_url":"https://api.github.com/repos/docker/distribution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/distribution/merges","archive_url":"https://api.github.com/repos/docker/distribution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/distribution/downloads","issues_url":"https://api.github.com/repos/docker/distribution/issues{/number}","pulls_url":"https://api.github.com/repos/docker/distribution/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/distribution/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/distribution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/distribution/labels{/name}","releases_url":"https://api.github.com/repos/docker/distribution/releases{/id}","created_at":"2014-12-22T23:49:26Z","updated_at":"2015-08-20T18:39:40Z","pushed_at":"2015-08-20T21:00:20Z","git_url":"git://github.com/docker/distribution.git","ssh_url":"git@github.com:docker/distribution.git","clone_url":"https://github.com/docker/distribution.git","svn_url":"https://github.com/docker/distribution","homepage":null,"size":12697,"stargazers_count":904,"watchers_count":904,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":341,"mirror_url":null,"open_issues_count":113,"forks":341,"open_issues":113,"watchers":904,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/distribution/pulls/901"},"html":{"href":"https://github.com/docker/distribution/pull/901"},"issue":{"href":"https://api.github.com/repos/docker/distribution/issues/901"},"comments":{"href":"https://api.github.com/repos/docker/distribution/issues/901/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/distribution/pulls/901/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/distribution/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/distribution/pulls/901/commits"},"statuses":{"href":"https://api.github.com/repos/docker/distribution/statuses/ffd2a904510496674801b91fb6194ebf671fb3ef"}}}}