{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin/pulls/comments/65414550","id":65414550,"diff_hunk":"@@ -282,6 +282,27 @@ func applyErrorToRepository(repository *importRepository, err error) {\n \t}\n }\n \n+func calculateImageSize(ctx gocontext.Context, repo distribution.Repository, image *api.Image) error {\n+\tbs := repo.Blobs(ctx)\n+\n+\tlayerSet := sets.NewString()\n+\tsize := int64(0)\n+\tfor i := range image.DockerImageLayers {\n+\t\tlayer := &image.DockerImageLayers[i]\n+\t\tdesc, err := bs.Stat(ctx, digest.Digest(layer.Name))","path":"pkg/image/importer/importer.go","position":11,"original_position":11,"commit_id":"4ebd85bdb506ec61ebb25d2dc2061e1fba388639","original_commit_id":"492baa03f23cf45ca229c3501c29ca4bccf546f3","user":{"login":"legionus","id":1690313,"avatar_url":"https://avatars.githubusercontent.com/u/1690313?v=3","gravatar_id":"","url":"https://api.github.com/users/legionus","html_url":"https://github.com/legionus","followers_url":"https://api.github.com/users/legionus/followers","following_url":"https://api.github.com/users/legionus/following{/other_user}","gists_url":"https://api.github.com/users/legionus/gists{/gist_id}","starred_url":"https://api.github.com/users/legionus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legionus/subscriptions","organizations_url":"https://api.github.com/users/legionus/orgs","repos_url":"https://api.github.com/users/legionus/repos","events_url":"https://api.github.com/users/legionus/events{/privacy}","received_events_url":"https://api.github.com/users/legionus/received_events","type":"User","site_admin":false},"body":"Schema v1 don't have the size:\r\n\r\nhttps://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-1.md#example-manifest\r\n\r\nSchema v2 have it:\r\n\r\nhttps://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#example-image-manifest\r\n\r\nBut right now we talking about schema v1.","created_at":"2016-06-01T18:17:06Z","updated_at":"2016-06-01T18:17:06Z","html_url":"https://github.com/openshift/origin/pull/9115#discussion_r65414550","pull_request_url":"https://api.github.com/repos/openshift/origin/pulls/9115","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments/65414550"},"html":{"href":"https://github.com/openshift/origin/pull/9115#discussion_r65414550"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin/pulls/9115"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/9115","id":72222024,"html_url":"https://github.com/openshift/origin/pull/9115","diff_url":"https://github.com/openshift/origin/pull/9115.diff","patch_url":"https://github.com/openshift/origin/pull/9115.patch","issue_url":"https://api.github.com/repos/openshift/origin/issues/9115","number":9115,"state":"open","locked":false,"title":"Fix image size calculation in importer","user":{"login":"legionus","id":1690313,"avatar_url":"https://avatars.githubusercontent.com/u/1690313?v=3","gravatar_id":"","url":"https://api.github.com/users/legionus","html_url":"https://github.com/legionus","followers_url":"https://api.github.com/users/legionus/followers","following_url":"https://api.github.com/users/legionus/following{/other_user}","gists_url":"https://api.github.com/users/legionus/gists{/gist_id}","starred_url":"https://api.github.com/users/legionus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legionus/subscriptions","organizations_url":"https://api.github.com/users/legionus/orgs","repos_url":"https://api.github.com/users/legionus/repos","events_url":"https://api.github.com/users/legionus/events{/privacy}","received_events_url":"https://api.github.com/users/legionus/received_events","type":"User","site_admin":false},"body":"After upgrading docker/distibution V1Compatibility no longer contains Size. For\r\nthis reason, the image size calculation is wrong. A new way to calculate the\r\nsize repeats the way that dockerregistry calculates the size.\r\n\r\nFix #7706 \r\n\r\n@smarterclayton @pweil- @mfojtik @miminar @kargakis ","created_at":"2016-06-01T17:38:51Z","updated_at":"2016-06-01T18:17:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50b32c279310b7e12028f7a7d2cb2a8529821afe","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin/pulls/9115/commits","review_comments_url":"https://api.github.com/repos/openshift/origin/pulls/9115/comments","review_comment_url":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin/issues/9115/comments","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/4ebd85bdb506ec61ebb25d2dc2061e1fba388639","head":{"label":"legionus:fix-image-metadata-size","ref":"fix-image-metadata-size","sha":"4ebd85bdb506ec61ebb25d2dc2061e1fba388639","user":{"login":"legionus","id":1690313,"avatar_url":"https://avatars.githubusercontent.com/u/1690313?v=3","gravatar_id":"","url":"https://api.github.com/users/legionus","html_url":"https://github.com/legionus","followers_url":"https://api.github.com/users/legionus/followers","following_url":"https://api.github.com/users/legionus/following{/other_user}","gists_url":"https://api.github.com/users/legionus/gists{/gist_id}","starred_url":"https://api.github.com/users/legionus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legionus/subscriptions","organizations_url":"https://api.github.com/users/legionus/orgs","repos_url":"https://api.github.com/users/legionus/repos","events_url":"https://api.github.com/users/legionus/events{/privacy}","received_events_url":"https://api.github.com/users/legionus/received_events","type":"User","site_admin":false},"repo":{"id":49266113,"name":"origin","full_name":"legionus/origin","owner":{"login":"legionus","id":1690313,"avatar_url":"https://avatars.githubusercontent.com/u/1690313?v=3","gravatar_id":"","url":"https://api.github.com/users/legionus","html_url":"https://github.com/legionus","followers_url":"https://api.github.com/users/legionus/followers","following_url":"https://api.github.com/users/legionus/following{/other_user}","gists_url":"https://api.github.com/users/legionus/gists{/gist_id}","starred_url":"https://api.github.com/users/legionus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legionus/subscriptions","organizations_url":"https://api.github.com/users/legionus/orgs","repos_url":"https://api.github.com/users/legionus/repos","events_url":"https://api.github.com/users/legionus/events{/privacy}","received_events_url":"https://api.github.com/users/legionus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/legionus/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":true,"url":"https://api.github.com/repos/legionus/origin","forks_url":"https://api.github.com/repos/legionus/origin/forks","keys_url":"https://api.github.com/repos/legionus/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/legionus/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/legionus/origin/teams","hooks_url":"https://api.github.com/repos/legionus/origin/hooks","issue_events_url":"https://api.github.com/repos/legionus/origin/issues/events{/number}","events_url":"https://api.github.com/repos/legionus/origin/events","assignees_url":"https://api.github.com/repos/legionus/origin/assignees{/user}","branches_url":"https://api.github.com/repos/legionus/origin/branches{/branch}","tags_url":"https://api.github.com/repos/legionus/origin/tags","blobs_url":"https://api.github.com/repos/legionus/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/legionus/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/legionus/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/legionus/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/legionus/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/legionus/origin/languages","stargazers_url":"https://api.github.com/repos/legionus/origin/stargazers","contributors_url":"https://api.github.com/repos/legionus/origin/contributors","subscribers_url":"https://api.github.com/repos/legionus/origin/subscribers","subscription_url":"https://api.github.com/repos/legionus/origin/subscription","commits_url":"https://api.github.com/repos/legionus/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/legionus/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/legionus/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/legionus/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/legionus/origin/contents/{+path}","compare_url":"https://api.github.com/repos/legionus/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/legionus/origin/merges","archive_url":"https://api.github.com/repos/legionus/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/legionus/origin/downloads","issues_url":"https://api.github.com/repos/legionus/origin/issues{/number}","pulls_url":"https://api.github.com/repos/legionus/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/legionus/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/legionus/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/legionus/origin/labels{/name}","releases_url":"https://api.github.com/repos/legionus/origin/releases{/id}","deployments_url":"https://api.github.com/repos/legionus/origin/deployments","created_at":"2016-01-08T10:32:30Z","updated_at":"2016-01-08T10:32:36Z","pushed_at":"2016-06-01T17:59:35Z","git_url":"git://github.com/legionus/origin.git","ssh_url":"git@github.com:legionus/origin.git","clone_url":"https://github.com/legionus/origin.git","svn_url":"https://github.com/legionus/origin","homepage":"http://www.openshift.org","size":265259,"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":"openshift:master","ref":"master","sha":"7afe72b7bde43e291b4dac2c45ee92ee9f620ab3","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":22442668,"name":"origin","full_name":"openshift/origin","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin","description":"OpenShift - Build, deploy, and manage cloud-native and legacy applications with Kubernetes and Docker","fork":false,"url":"https://api.github.com/repos/openshift/origin","forks_url":"https://api.github.com/repos/openshift/origin/forks","keys_url":"https://api.github.com/repos/openshift/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin/teams","hooks_url":"https://api.github.com/repos/openshift/origin/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin/events","assignees_url":"https://api.github.com/repos/openshift/origin/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin/tags","blobs_url":"https://api.github.com/repos/openshift/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin/languages","stargazers_url":"https://api.github.com/repos/openshift/origin/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin/subscription","commits_url":"https://api.github.com/repos/openshift/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin/merges","archive_url":"https://api.github.com/repos/openshift/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin/downloads","issues_url":"https://api.github.com/repos/openshift/origin/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/origin/deployments","created_at":"2014-07-30T20:04:05Z","updated_at":"2016-06-01T17:51:08Z","pushed_at":"2016-06-01T18:07:40Z","git_url":"git://github.com/openshift/origin.git","ssh_url":"git@github.com:openshift/origin.git","clone_url":"https://github.com/openshift/origin.git","svn_url":"https://github.com/openshift/origin","homepage":"http://www.openshift.org","size":509625,"stargazers_count":1326,"watchers_count":1326,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":799,"mirror_url":null,"open_issues_count":1042,"forks":799,"open_issues":1042,"watchers":1326,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/9115"},"html":{"href":"https://github.com/openshift/origin/pull/9115"},"issue":{"href":"https://api.github.com/repos/openshift/origin/issues/9115"},"comments":{"href":"https://api.github.com/repos/openshift/origin/issues/9115/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin/pulls/9115/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin/pulls/9115/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin/statuses/4ebd85bdb506ec61ebb25d2dc2061e1fba388639"}}}}
{"actor":{"display_login":"legionus"}}