{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin/pulls/comments/82772341","pull_request_review_id":3655486,"id":82772341,"diff_hunk":"@@ -312,11 +312,15 @@ func checkImportFailure(status api.ImageImportStatus, stream *api.ImageStream, t\n \t}\n \n \tif !api.HasTagCondition(stream, tag, condition) {\n-\t\tapi.SetTagConditions(stream, tag, condition)\n-\t\tif tagRef, ok := stream.Spec.Tags[tag]; ok {\n-\t\t\tzero := int64(0)\n-\t\t\ttagRef.Generation = &zero\n-\t\t\tstream.Spec.Tags[tag] = tagRef\n+\t\tif len(tag) > 0 {\n+\t\t\tapi.SetTagConditions(stream, tag, condition)\n+\t\t\tif tagRef, ok := stream.Spec.Tags[tag]; ok {\n+\t\t\t\tzero := int64(0)\n+\t\t\t\ttagRef.Generation = &zero\n+\t\t\t\tstream.Spec.Tags[tag] = tagRef\n+\t\t\t}\n+\t\t} else {\n+\t\t\tglog.Errorln(\"tag conditions can't be set, because the tag of image is empty string\")","path":"pkg/image/registry/imagestreamimport/rest.go","position":17,"original_position":17,"commit_id":"bfa0a942672c95cdc276ce23d2d909ca7ae34372","original_commit_id":"bfa0a942672c95cdc276ce23d2d909ca7ae34372","user":{"login":"miminar","id":1478803,"avatar_url":"https://avatars.githubusercontent.com/u/1478803?v=3","gravatar_id":"","url":"https://api.github.com/users/miminar","html_url":"https://github.com/miminar","followers_url":"https://api.github.com/users/miminar/followers","following_url":"https://api.github.com/users/miminar/following{/other_user}","gists_url":"https://api.github.com/users/miminar/gists{/gist_id}","starred_url":"https://api.github.com/users/miminar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miminar/subscriptions","organizations_url":"https://api.github.com/users/miminar/orgs","repos_url":"https://api.github.com/users/miminar/repos","events_url":"https://api.github.com/users/miminar/events{/privacy}","received_events_url":"https://api.github.com/users/miminar/received_events","type":"User","site_admin":false},"body":"Could you rewrite to something like:\r\n\r\n```go\r\nglog.Error(\"tag unset - not setting failed import condition on stream=\\\"%s/%s\\\" reason=%q: %s\", stream.Namespace, stream.Name, condition.Reason, condition.Message)\r\n```","created_at":"2016-10-11T11:22:56Z","updated_at":"2016-10-11T11:23:57Z","html_url":"https://github.com/openshift/origin/pull/11131#discussion_r82772341","pull_request_url":"https://api.github.com/repos/openshift/origin/pulls/11131","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments/82772341"},"html":{"href":"https://github.com/openshift/origin/pull/11131#discussion_r82772341"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin/pulls/11131"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/11131","id":87076663,"html_url":"https://github.com/openshift/origin/pull/11131","diff_url":"https://github.com/openshift/origin/pull/11131.diff","patch_url":"https://github.com/openshift/origin/pull/11131.patch","issue_url":"https://api.github.com/repos/openshift/origin/issues/11131","number":11131,"state":"open","locked":false,"title":"Tag cannot be a empty string","user":{"login":"miaoyq","id":17755856,"avatar_url":"https://avatars.githubusercontent.com/u/17755856?v=3","gravatar_id":"","url":"https://api.github.com/users/miaoyq","html_url":"https://github.com/miaoyq","followers_url":"https://api.github.com/users/miaoyq/followers","following_url":"https://api.github.com/users/miaoyq/following{/other_user}","gists_url":"https://api.github.com/users/miaoyq/gists{/gist_id}","starred_url":"https://api.github.com/users/miaoyq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miaoyq/subscriptions","organizations_url":"https://api.github.com/users/miaoyq/orgs","repos_url":"https://api.github.com/users/miaoyq/repos","events_url":"https://api.github.com/users/miaoyq/events{/privacy}","received_events_url":"https://api.github.com/users/miaoyq/received_events","type":"User","site_admin":false},"body":"Tag cannot be a empty string, because it will be used in the following code。","created_at":"2016-09-28T08:40:14Z","updated_at":"2016-10-11T11:23:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef823ab8f28fa94565590149ddc8b87f1382257e","assignee":{"login":"mfojtik","id":44136,"avatar_url":"https://avatars.githubusercontent.com/u/44136?v=3","gravatar_id":"","url":"https://api.github.com/users/mfojtik","html_url":"https://github.com/mfojtik","followers_url":"https://api.github.com/users/mfojtik/followers","following_url":"https://api.github.com/users/mfojtik/following{/other_user}","gists_url":"https://api.github.com/users/mfojtik/gists{/gist_id}","starred_url":"https://api.github.com/users/mfojtik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfojtik/subscriptions","organizations_url":"https://api.github.com/users/mfojtik/orgs","repos_url":"https://api.github.com/users/mfojtik/repos","events_url":"https://api.github.com/users/mfojtik/events{/privacy}","received_events_url":"https://api.github.com/users/mfojtik/received_events","type":"User","site_admin":false},"assignees":[{"login":"mfojtik","id":44136,"avatar_url":"https://avatars.githubusercontent.com/u/44136?v=3","gravatar_id":"","url":"https://api.github.com/users/mfojtik","html_url":"https://github.com/mfojtik","followers_url":"https://api.github.com/users/mfojtik/followers","following_url":"https://api.github.com/users/mfojtik/following{/other_user}","gists_url":"https://api.github.com/users/mfojtik/gists{/gist_id}","starred_url":"https://api.github.com/users/mfojtik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfojtik/subscriptions","organizations_url":"https://api.github.com/users/mfojtik/orgs","repos_url":"https://api.github.com/users/mfojtik/repos","events_url":"https://api.github.com/users/mfojtik/events{/privacy}","received_events_url":"https://api.github.com/users/mfojtik/received_events","type":"User","site_admin":false},{"login":"miminar","id":1478803,"avatar_url":"https://avatars.githubusercontent.com/u/1478803?v=3","gravatar_id":"","url":"https://api.github.com/users/miminar","html_url":"https://github.com/miminar","followers_url":"https://api.github.com/users/miminar/followers","following_url":"https://api.github.com/users/miminar/following{/other_user}","gists_url":"https://api.github.com/users/miminar/gists{/gist_id}","starred_url":"https://api.github.com/users/miminar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miminar/subscriptions","organizations_url":"https://api.github.com/users/miminar/orgs","repos_url":"https://api.github.com/users/miminar/repos","events_url":"https://api.github.com/users/miminar/events{/privacy}","received_events_url":"https://api.github.com/users/miminar/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin/pulls/11131/commits","review_comments_url":"https://api.github.com/repos/openshift/origin/pulls/11131/comments","review_comment_url":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin/issues/11131/comments","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/bfa0a942672c95cdc276ce23d2d909ca7ae34372","head":{"label":"miaoyq:add-empty-str-judgment","ref":"add-empty-str-judgment","sha":"bfa0a942672c95cdc276ce23d2d909ca7ae34372","user":{"login":"miaoyq","id":17755856,"avatar_url":"https://avatars.githubusercontent.com/u/17755856?v=3","gravatar_id":"","url":"https://api.github.com/users/miaoyq","html_url":"https://github.com/miaoyq","followers_url":"https://api.github.com/users/miaoyq/followers","following_url":"https://api.github.com/users/miaoyq/following{/other_user}","gists_url":"https://api.github.com/users/miaoyq/gists{/gist_id}","starred_url":"https://api.github.com/users/miaoyq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miaoyq/subscriptions","organizations_url":"https://api.github.com/users/miaoyq/orgs","repos_url":"https://api.github.com/users/miaoyq/repos","events_url":"https://api.github.com/users/miaoyq/events{/privacy}","received_events_url":"https://api.github.com/users/miaoyq/received_events","type":"User","site_admin":false},"repo":{"id":63936439,"name":"origin","full_name":"miaoyq/origin","owner":{"login":"miaoyq","id":17755856,"avatar_url":"https://avatars.githubusercontent.com/u/17755856?v=3","gravatar_id":"","url":"https://api.github.com/users/miaoyq","html_url":"https://github.com/miaoyq","followers_url":"https://api.github.com/users/miaoyq/followers","following_url":"https://api.github.com/users/miaoyq/following{/other_user}","gists_url":"https://api.github.com/users/miaoyq/gists{/gist_id}","starred_url":"https://api.github.com/users/miaoyq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miaoyq/subscriptions","organizations_url":"https://api.github.com/users/miaoyq/orgs","repos_url":"https://api.github.com/users/miaoyq/repos","events_url":"https://api.github.com/users/miaoyq/events{/privacy}","received_events_url":"https://api.github.com/users/miaoyq/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/miaoyq/origin","description":"Enterprise-Ready Kubernetes for Developers","fork":true,"url":"https://api.github.com/repos/miaoyq/origin","forks_url":"https://api.github.com/repos/miaoyq/origin/forks","keys_url":"https://api.github.com/repos/miaoyq/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/miaoyq/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/miaoyq/origin/teams","hooks_url":"https://api.github.com/repos/miaoyq/origin/hooks","issue_events_url":"https://api.github.com/repos/miaoyq/origin/issues/events{/number}","events_url":"https://api.github.com/repos/miaoyq/origin/events","assignees_url":"https://api.github.com/repos/miaoyq/origin/assignees{/user}","branches_url":"https://api.github.com/repos/miaoyq/origin/branches{/branch}","tags_url":"https://api.github.com/repos/miaoyq/origin/tags","blobs_url":"https://api.github.com/repos/miaoyq/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/miaoyq/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/miaoyq/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/miaoyq/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/miaoyq/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/miaoyq/origin/languages","stargazers_url":"https://api.github.com/repos/miaoyq/origin/stargazers","contributors_url":"https://api.github.com/repos/miaoyq/origin/contributors","subscribers_url":"https://api.github.com/repos/miaoyq/origin/subscribers","subscription_url":"https://api.github.com/repos/miaoyq/origin/subscription","commits_url":"https://api.github.com/repos/miaoyq/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/miaoyq/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/miaoyq/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/miaoyq/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/miaoyq/origin/contents/{+path}","compare_url":"https://api.github.com/repos/miaoyq/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/miaoyq/origin/merges","archive_url":"https://api.github.com/repos/miaoyq/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/miaoyq/origin/downloads","issues_url":"https://api.github.com/repos/miaoyq/origin/issues{/number}","pulls_url":"https://api.github.com/repos/miaoyq/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/miaoyq/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/miaoyq/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/miaoyq/origin/labels{/name}","releases_url":"https://api.github.com/repos/miaoyq/origin/releases{/id}","deployments_url":"https://api.github.com/repos/miaoyq/origin/deployments","created_at":"2016-07-22T08:17:37Z","updated_at":"2016-07-22T08:17:46Z","pushed_at":"2016-10-11T02:18:00Z","git_url":"git://github.com/miaoyq/origin.git","ssh_url":"git@github.com:miaoyq/origin.git","clone_url":"https://github.com/miaoyq/origin.git","svn_url":"https://github.com/miaoyq/origin","homepage":"http://www.openshift.org","size":343031,"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":"8f6030a36e51fabb7f894badfe2f14a2823e819f","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":"Enterprise-Ready Kubernetes for Developers","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-10-11T02:54:53Z","pushed_at":"2016-10-11T10:58:12Z","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":595146,"stargazers_count":1822,"watchers_count":1822,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1208,"mirror_url":null,"open_issues_count":1239,"forks":1208,"open_issues":1239,"watchers":1822,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/11131"},"html":{"href":"https://github.com/openshift/origin/pull/11131"},"issue":{"href":"https://api.github.com/repos/openshift/origin/issues/11131"},"comments":{"href":"https://api.github.com/repos/openshift/origin/issues/11131/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin/pulls/11131/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin/pulls/11131/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin/statuses/bfa0a942672c95cdc276ce23d2d909ca7ae34372"}}}}
{"actor":{"display_login":"miminar"}}