{"action":"created","comment":{"url":"https://api.github.com/repos/spinnaker/clouddriver/pulls/comments/71845097","id":71845097,"diff_hunk":"@@ -198,15 +201,27 @@ class DockerRegistryClient {\n    * This method will hit the /v2/ endpoint of the configured docker registry. If it this endpoint is up,\n    * it will return silently. Otherwise, an exception is thrown detailing why the endpoint isn't available.\n    */\n+\n   public void checkV2Availability() {\n+    try {\n+      doRequest(tokenService.basicAuthHeader)\n+    } catch (RetrofitError error) {\n+        LOG.warn \"checkV2Availability\", error\n+        Response response = doRequest(null)\n+        if(response != null){\n+          throw error\n+        }\n+    }\n+    // Placate the linter (otherwise it expects to return the result of `request()`)\n+    null\n+  }\n+\n+  private Response doRequest(String basicAuthHeader) {","path":"clouddriver-docker/src/main/groovy/com/netflix/spinnaker/clouddriver/docker/registry/api/v2/client/DockerRegistryClient.groovy","position":null,"original_position":29,"commit_id":"dc2a99d581cf7828126f5c55231f61da29f7a2f8","original_commit_id":"75dc3be2598e6fa289e2cd55d536a370f8313cdc","user":{"login":"tgracchus","id":10425379,"avatar_url":"https://avatars.githubusercontent.com/u/10425379?v=3","gravatar_id":"","url":"https://api.github.com/users/tgracchus","html_url":"https://github.com/tgracchus","followers_url":"https://api.github.com/users/tgracchus/followers","following_url":"https://api.github.com/users/tgracchus/following{/other_user}","gists_url":"https://api.github.com/users/tgracchus/gists{/gist_id}","starred_url":"https://api.github.com/users/tgracchus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgracchus/subscriptions","organizations_url":"https://api.github.com/users/tgracchus/orgs","repos_url":"https://api.github.com/users/tgracchus/repos","events_url":"https://api.github.com/users/tgracchus/events{/privacy}","received_events_url":"https://api.github.com/users/tgracchus/received_events","type":"User","site_admin":false},"body":"Just Renamed.","created_at":"2016-07-22T08:37:35Z","updated_at":"2016-07-22T08:37:35Z","html_url":"https://github.com/spinnaker/clouddriver/pull/786#discussion_r71845097","pull_request_url":"https://api.github.com/repos/spinnaker/clouddriver/pulls/786","_links":{"self":{"href":"https://api.github.com/repos/spinnaker/clouddriver/pulls/comments/71845097"},"html":{"href":"https://github.com/spinnaker/clouddriver/pull/786#discussion_r71845097"},"pull_request":{"href":"https://api.github.com/repos/spinnaker/clouddriver/pulls/786"}}},"pull_request":{"url":"https://api.github.com/repos/spinnaker/clouddriver/pulls/786","id":77930939,"html_url":"https://github.com/spinnaker/clouddriver/pull/786","diff_url":"https://github.com/spinnaker/clouddriver/pull/786.diff","patch_url":"https://github.com/spinnaker/clouddriver/pull/786.patch","issue_url":"https://api.github.com/repos/spinnaker/clouddriver/issues/786","number":786,"state":"open","locked":false,"title":"Docker registry","user":{"login":"tgracchus","id":10425379,"avatar_url":"https://avatars.githubusercontent.com/u/10425379?v=3","gravatar_id":"","url":"https://api.github.com/users/tgracchus","html_url":"https://github.com/tgracchus","followers_url":"https://api.github.com/users/tgracchus/followers","following_url":"https://api.github.com/users/tgracchus/following{/other_user}","gists_url":"https://api.github.com/users/tgracchus/gists{/gist_id}","starred_url":"https://api.github.com/users/tgracchus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgracchus/subscriptions","organizations_url":"https://api.github.com/users/tgracchus/orgs","repos_url":"https://api.github.com/users/tgracchus/repos","events_url":"https://api.github.com/users/tgracchus/events{/privacy}","received_events_url":"https://api.github.com/users/tgracchus/received_events","type":"User","site_admin":false},"body":"Equipare the docker cli behaviour and the clouddriver behavior \r\n\r\nWhen login to a docker registry, the official behaviour is defined here\r\nhttps://docs.docker.com/registry/spec/auth/token/\r\n\r\n1. So, the first think it is trying to do is a connection to /v2/ endpoint\r\n2. The server respond with a 401 with the auth details in the response\r\n3. Then, the client try to auth.\r\n\r\nIn this first request is very docker cli and clouddriver differs.\r\n\r\nDocker:\r\nDocker client sends this first request without Authorization Header, see line 65 of attached log.\r\n[nginx.txt](https://github.com/spinnaker/clouddriver/files/370858/nginx.txt)\r\n\r\nCloudDriver:\r\nSends the query with the Authorization Header\r\n\r\nThis slightly difference makes our clouddriver to be down, cause the Docker Health Check always fails.\r\n\r\nSo, this PR pretends to make clouddriver behave in the same way as the docker client\r\n\r\n\r\n\r\n","created_at":"2016-07-19T07:42:55Z","updated_at":"2016-07-22T08:37:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"27bdf5c203eddd069b76a655f9732e9a44874545","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/spinnaker/clouddriver/pulls/786/commits","review_comments_url":"https://api.github.com/repos/spinnaker/clouddriver/pulls/786/comments","review_comment_url":"https://api.github.com/repos/spinnaker/clouddriver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spinnaker/clouddriver/issues/786/comments","statuses_url":"https://api.github.com/repos/spinnaker/clouddriver/statuses/dc2a99d581cf7828126f5c55231f61da29f7a2f8","head":{"label":"tgracchus:docker-registry","ref":"docker-registry","sha":"dc2a99d581cf7828126f5c55231f61da29f7a2f8","user":{"login":"tgracchus","id":10425379,"avatar_url":"https://avatars.githubusercontent.com/u/10425379?v=3","gravatar_id":"","url":"https://api.github.com/users/tgracchus","html_url":"https://github.com/tgracchus","followers_url":"https://api.github.com/users/tgracchus/followers","following_url":"https://api.github.com/users/tgracchus/following{/other_user}","gists_url":"https://api.github.com/users/tgracchus/gists{/gist_id}","starred_url":"https://api.github.com/users/tgracchus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgracchus/subscriptions","organizations_url":"https://api.github.com/users/tgracchus/orgs","repos_url":"https://api.github.com/users/tgracchus/repos","events_url":"https://api.github.com/users/tgracchus/events{/privacy}","received_events_url":"https://api.github.com/users/tgracchus/received_events","type":"User","site_admin":false},"repo":{"id":60255779,"name":"clouddriver","full_name":"tgracchus/clouddriver","owner":{"login":"tgracchus","id":10425379,"avatar_url":"https://avatars.githubusercontent.com/u/10425379?v=3","gravatar_id":"","url":"https://api.github.com/users/tgracchus","html_url":"https://github.com/tgracchus","followers_url":"https://api.github.com/users/tgracchus/followers","following_url":"https://api.github.com/users/tgracchus/following{/other_user}","gists_url":"https://api.github.com/users/tgracchus/gists{/gist_id}","starred_url":"https://api.github.com/users/tgracchus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgracchus/subscriptions","organizations_url":"https://api.github.com/users/tgracchus/orgs","repos_url":"https://api.github.com/users/tgracchus/repos","events_url":"https://api.github.com/users/tgracchus/events{/privacy}","received_events_url":"https://api.github.com/users/tgracchus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tgracchus/clouddriver","description":"read and write operations across cloud providers","fork":true,"url":"https://api.github.com/repos/tgracchus/clouddriver","forks_url":"https://api.github.com/repos/tgracchus/clouddriver/forks","keys_url":"https://api.github.com/repos/tgracchus/clouddriver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tgracchus/clouddriver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tgracchus/clouddriver/teams","hooks_url":"https://api.github.com/repos/tgracchus/clouddriver/hooks","issue_events_url":"https://api.github.com/repos/tgracchus/clouddriver/issues/events{/number}","events_url":"https://api.github.com/repos/tgracchus/clouddriver/events","assignees_url":"https://api.github.com/repos/tgracchus/clouddriver/assignees{/user}","branches_url":"https://api.github.com/repos/tgracchus/clouddriver/branches{/branch}","tags_url":"https://api.github.com/repos/tgracchus/clouddriver/tags","blobs_url":"https://api.github.com/repos/tgracchus/clouddriver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tgracchus/clouddriver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tgracchus/clouddriver/git/refs{/sha}","trees_url":"https://api.github.com/repos/tgracchus/clouddriver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tgracchus/clouddriver/statuses/{sha}","languages_url":"https://api.github.com/repos/tgracchus/clouddriver/languages","stargazers_url":"https://api.github.com/repos/tgracchus/clouddriver/stargazers","contributors_url":"https://api.github.com/repos/tgracchus/clouddriver/contributors","subscribers_url":"https://api.github.com/repos/tgracchus/clouddriver/subscribers","subscription_url":"https://api.github.com/repos/tgracchus/clouddriver/subscription","commits_url":"https://api.github.com/repos/tgracchus/clouddriver/commits{/sha}","git_commits_url":"https://api.github.com/repos/tgracchus/clouddriver/git/commits{/sha}","comments_url":"https://api.github.com/repos/tgracchus/clouddriver/comments{/number}","issue_comment_url":"https://api.github.com/repos/tgracchus/clouddriver/issues/comments{/number}","contents_url":"https://api.github.com/repos/tgracchus/clouddriver/contents/{+path}","compare_url":"https://api.github.com/repos/tgracchus/clouddriver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tgracchus/clouddriver/merges","archive_url":"https://api.github.com/repos/tgracchus/clouddriver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tgracchus/clouddriver/downloads","issues_url":"https://api.github.com/repos/tgracchus/clouddriver/issues{/number}","pulls_url":"https://api.github.com/repos/tgracchus/clouddriver/pulls{/number}","milestones_url":"https://api.github.com/repos/tgracchus/clouddriver/milestones{/number}","notifications_url":"https://api.github.com/repos/tgracchus/clouddriver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tgracchus/clouddriver/labels{/name}","releases_url":"https://api.github.com/repos/tgracchus/clouddriver/releases{/id}","deployments_url":"https://api.github.com/repos/tgracchus/clouddriver/deployments","created_at":"2016-06-02T10:38:29Z","updated_at":"2016-06-02T10:38:35Z","pushed_at":"2016-07-22T08:34:08Z","git_url":"git://github.com/tgracchus/clouddriver.git","ssh_url":"git@github.com:tgracchus/clouddriver.git","clone_url":"https://github.com/tgracchus/clouddriver.git","svn_url":"https://github.com/tgracchus/clouddriver","homepage":null,"size":27443,"stargazers_count":0,"watchers_count":0,"language":"Groovy","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":"spinnaker:master","ref":"master","sha":"cb99255491236ca6c17613b66c8133bc6f765dca","user":{"login":"spinnaker","id":7634182,"avatar_url":"https://avatars.githubusercontent.com/u/7634182?v=3","gravatar_id":"","url":"https://api.github.com/users/spinnaker","html_url":"https://github.com/spinnaker","followers_url":"https://api.github.com/users/spinnaker/followers","following_url":"https://api.github.com/users/spinnaker/following{/other_user}","gists_url":"https://api.github.com/users/spinnaker/gists{/gist_id}","starred_url":"https://api.github.com/users/spinnaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spinnaker/subscriptions","organizations_url":"https://api.github.com/users/spinnaker/orgs","repos_url":"https://api.github.com/users/spinnaker/repos","events_url":"https://api.github.com/users/spinnaker/events{/privacy}","received_events_url":"https://api.github.com/users/spinnaker/received_events","type":"Organization","site_admin":false},"repo":{"id":37556951,"name":"clouddriver","full_name":"spinnaker/clouddriver","owner":{"login":"spinnaker","id":7634182,"avatar_url":"https://avatars.githubusercontent.com/u/7634182?v=3","gravatar_id":"","url":"https://api.github.com/users/spinnaker","html_url":"https://github.com/spinnaker","followers_url":"https://api.github.com/users/spinnaker/followers","following_url":"https://api.github.com/users/spinnaker/following{/other_user}","gists_url":"https://api.github.com/users/spinnaker/gists{/gist_id}","starred_url":"https://api.github.com/users/spinnaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spinnaker/subscriptions","organizations_url":"https://api.github.com/users/spinnaker/orgs","repos_url":"https://api.github.com/users/spinnaker/repos","events_url":"https://api.github.com/users/spinnaker/events{/privacy}","received_events_url":"https://api.github.com/users/spinnaker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spinnaker/clouddriver","description":"read and write operations across cloud providers","fork":false,"url":"https://api.github.com/repos/spinnaker/clouddriver","forks_url":"https://api.github.com/repos/spinnaker/clouddriver/forks","keys_url":"https://api.github.com/repos/spinnaker/clouddriver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spinnaker/clouddriver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spinnaker/clouddriver/teams","hooks_url":"https://api.github.com/repos/spinnaker/clouddriver/hooks","issue_events_url":"https://api.github.com/repos/spinnaker/clouddriver/issues/events{/number}","events_url":"https://api.github.com/repos/spinnaker/clouddriver/events","assignees_url":"https://api.github.com/repos/spinnaker/clouddriver/assignees{/user}","branches_url":"https://api.github.com/repos/spinnaker/clouddriver/branches{/branch}","tags_url":"https://api.github.com/repos/spinnaker/clouddriver/tags","blobs_url":"https://api.github.com/repos/spinnaker/clouddriver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spinnaker/clouddriver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spinnaker/clouddriver/git/refs{/sha}","trees_url":"https://api.github.com/repos/spinnaker/clouddriver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spinnaker/clouddriver/statuses/{sha}","languages_url":"https://api.github.com/repos/spinnaker/clouddriver/languages","stargazers_url":"https://api.github.com/repos/spinnaker/clouddriver/stargazers","contributors_url":"https://api.github.com/repos/spinnaker/clouddriver/contributors","subscribers_url":"https://api.github.com/repos/spinnaker/clouddriver/subscribers","subscription_url":"https://api.github.com/repos/spinnaker/clouddriver/subscription","commits_url":"https://api.github.com/repos/spinnaker/clouddriver/commits{/sha}","git_commits_url":"https://api.github.com/repos/spinnaker/clouddriver/git/commits{/sha}","comments_url":"https://api.github.com/repos/spinnaker/clouddriver/comments{/number}","issue_comment_url":"https://api.github.com/repos/spinnaker/clouddriver/issues/comments{/number}","contents_url":"https://api.github.com/repos/spinnaker/clouddriver/contents/{+path}","compare_url":"https://api.github.com/repos/spinnaker/clouddriver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spinnaker/clouddriver/merges","archive_url":"https://api.github.com/repos/spinnaker/clouddriver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spinnaker/clouddriver/downloads","issues_url":"https://api.github.com/repos/spinnaker/clouddriver/issues{/number}","pulls_url":"https://api.github.com/repos/spinnaker/clouddriver/pulls{/number}","milestones_url":"https://api.github.com/repos/spinnaker/clouddriver/milestones{/number}","notifications_url":"https://api.github.com/repos/spinnaker/clouddriver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spinnaker/clouddriver/labels{/name}","releases_url":"https://api.github.com/repos/spinnaker/clouddriver/releases{/id}","deployments_url":"https://api.github.com/repos/spinnaker/clouddriver/deployments","created_at":"2015-06-16T21:26:02Z","updated_at":"2016-07-22T00:49:22Z","pushed_at":"2016-07-22T08:34:08Z","git_url":"git://github.com/spinnaker/clouddriver.git","ssh_url":"git@github.com:spinnaker/clouddriver.git","clone_url":"https://github.com/spinnaker/clouddriver.git","svn_url":"https://github.com/spinnaker/clouddriver","homepage":null,"size":29689,"stargazers_count":59,"watchers_count":59,"language":"Groovy","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":85,"mirror_url":null,"open_issues_count":8,"forks":85,"open_issues":8,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spinnaker/clouddriver/pulls/786"},"html":{"href":"https://github.com/spinnaker/clouddriver/pull/786"},"issue":{"href":"https://api.github.com/repos/spinnaker/clouddriver/issues/786"},"comments":{"href":"https://api.github.com/repos/spinnaker/clouddriver/issues/786/comments"},"review_comments":{"href":"https://api.github.com/repos/spinnaker/clouddriver/pulls/786/comments"},"review_comment":{"href":"https://api.github.com/repos/spinnaker/clouddriver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spinnaker/clouddriver/pulls/786/commits"},"statuses":{"href":"https://api.github.com/repos/spinnaker/clouddriver/statuses/dc2a99d581cf7828126f5c55231f61da29f7a2f8"}}}}
{"actor":{"display_login":"tgracchus"}}