{"action":"created","comment":{"url":"https://api.github.com/repos/containers/image/pulls/comments/129029015","pull_request_review_id":51760940,"id":129029015,"diff_hunk":"@@ -19,22 +19,28 @@ func newImageDestination(ctx *types.SystemContext, ref archiveReference) (types.\n \tif ref.destinationRef == nil {\n \t\treturn nil, errors.Errorf(\"docker-archive: destination reference not supplied (must be of form <path>:<reference:tag>)\")\n \t}\n-\tfh, err := os.OpenFile(ref.path, os.O_WRONLY|os.O_EXCL|os.O_CREATE, 0644)\n+\n+\t// the file needs to be created for write only\n+\t// if the file prexisted it needs to be empty\n+\tfh, err := os.OpenFile(ref.path, os.O_WRONLY|os.O_CREATE, 0644)\n+\tif err != nil {\n+\t\treturn nil, errors.Wrapf(err, \"error opening file %q\", ref.path)\n+\t}\n+\n+\tfhStat, err := fh.Stat()\n \tif err != nil {\n-\t\t// FIXME: It should be possible to modify archives, but the only really\n-\t\t//        sane way of doing it is to create a copy of the image, modify\n-\t\t//        it and then do a rename(2).\n-\t\tif os.IsExist(err) {\n-\t\t\terr = errors.New(\"docker-archive doesn't support modifying existing images\")\n-\t\t}\n-\t\treturn nil, err\n+\t\treturn nil, errors.Wrapf(err, \"error retrieving stat of file\")","path":"docker/archive/dest.go","position":null,"original_position":22,"commit_id":"2a1601f067ed9fe350afdeded26326b24491d256","original_commit_id":"230921c63abc294e4b924eb0c1decab112dcdcb1","user":{"login":"umohnani8","id":29377163,"avatar_url":"https://avatars0.githubusercontent.com/u/29377163?v=4","gravatar_id":"","url":"https://api.github.com/users/umohnani8","html_url":"https://github.com/umohnani8","followers_url":"https://api.github.com/users/umohnani8/followers","following_url":"https://api.github.com/users/umohnani8/following{/other_user}","gists_url":"https://api.github.com/users/umohnani8/gists{/gist_id}","starred_url":"https://api.github.com/users/umohnani8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umohnani8/subscriptions","organizations_url":"https://api.github.com/users/umohnani8/orgs","repos_url":"https://api.github.com/users/umohnani8/repos","events_url":"https://api.github.com/users/umohnani8/events{/privacy}","received_events_url":"https://api.github.com/users/umohnani8/received_events","type":"User","site_admin":false},"body":"Fixed.","created_at":"2017-07-24T13:05:19Z","updated_at":"2017-07-24T13:05:19Z","html_url":"https://github.com/containers/image/pull/313#discussion_r129029015","pull_request_url":"https://api.github.com/repos/containers/image/pulls/313","_links":{"self":{"href":"https://api.github.com/repos/containers/image/pulls/comments/129029015"},"html":{"href":"https://github.com/containers/image/pull/313#discussion_r129029015"},"pull_request":{"href":"https://api.github.com/repos/containers/image/pulls/313"}}},"pull_request":{"url":"https://api.github.com/repos/containers/image/pulls/313","id":131637964,"html_url":"https://github.com/containers/image/pull/313","diff_url":"https://github.com/containers/image/pull/313.diff","patch_url":"https://github.com/containers/image/pull/313.patch","issue_url":"https://api.github.com/repos/containers/image/issues/313","number":313,"state":"open","locked":false,"title":"Add fixes to newImageDestination to allow kpod load to write to a file when stdout is redirected","user":{"login":"umohnani8","id":29377163,"avatar_url":"https://avatars0.githubusercontent.com/u/29377163?v=4","gravatar_id":"","url":"https://api.github.com/users/umohnani8","html_url":"https://github.com/umohnani8","followers_url":"https://api.github.com/users/umohnani8/followers","following_url":"https://api.github.com/users/umohnani8/following{/other_user}","gists_url":"https://api.github.com/users/umohnani8/gists{/gist_id}","starred_url":"https://api.github.com/users/umohnani8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umohnani8/subscriptions","organizations_url":"https://api.github.com/users/umohnani8/orgs","repos_url":"https://api.github.com/users/umohnani8/repos","events_url":"https://api.github.com/users/umohnani8/events{/privacy}","received_events_url":"https://api.github.com/users/umohnani8/received_events","type":"User","site_admin":false},"body":"Need this fix for kpod load so that stdout can write to a file when redirected. Checks if the file exists and is empty first as the file is created then written to.\r\n\r\nSigned-off-by: umohnani8 <umohnani@redhat.com>","created_at":"2017-07-20T20:01:11Z","updated_at":"2017-07-24T13:05:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d84f8818b298bd502152ee9f1901944b5cbec67c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/containers/image/pulls/313/commits","review_comments_url":"https://api.github.com/repos/containers/image/pulls/313/comments","review_comment_url":"https://api.github.com/repos/containers/image/pulls/comments{/number}","comments_url":"https://api.github.com/repos/containers/image/issues/313/comments","statuses_url":"https://api.github.com/repos/containers/image/statuses/2a1601f067ed9fe350afdeded26326b24491d256","head":{"label":"umohnani8:master","ref":"master","sha":"2a1601f067ed9fe350afdeded26326b24491d256","user":{"login":"umohnani8","id":29377163,"avatar_url":"https://avatars0.githubusercontent.com/u/29377163?v=4","gravatar_id":"","url":"https://api.github.com/users/umohnani8","html_url":"https://github.com/umohnani8","followers_url":"https://api.github.com/users/umohnani8/followers","following_url":"https://api.github.com/users/umohnani8/following{/other_user}","gists_url":"https://api.github.com/users/umohnani8/gists{/gist_id}","starred_url":"https://api.github.com/users/umohnani8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umohnani8/subscriptions","organizations_url":"https://api.github.com/users/umohnani8/orgs","repos_url":"https://api.github.com/users/umohnani8/repos","events_url":"https://api.github.com/users/umohnani8/events{/privacy}","received_events_url":"https://api.github.com/users/umohnani8/received_events","type":"User","site_admin":false},"repo":{"id":97640905,"name":"image","full_name":"umohnani8/image","owner":{"login":"umohnani8","id":29377163,"avatar_url":"https://avatars0.githubusercontent.com/u/29377163?v=4","gravatar_id":"","url":"https://api.github.com/users/umohnani8","html_url":"https://github.com/umohnani8","followers_url":"https://api.github.com/users/umohnani8/followers","following_url":"https://api.github.com/users/umohnani8/following{/other_user}","gists_url":"https://api.github.com/users/umohnani8/gists{/gist_id}","starred_url":"https://api.github.com/users/umohnani8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umohnani8/subscriptions","organizations_url":"https://api.github.com/users/umohnani8/orgs","repos_url":"https://api.github.com/users/umohnani8/repos","events_url":"https://api.github.com/users/umohnani8/events{/privacy}","received_events_url":"https://api.github.com/users/umohnani8/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/umohnani8/image","description":"Work with containers' images","fork":true,"url":"https://api.github.com/repos/umohnani8/image","forks_url":"https://api.github.com/repos/umohnani8/image/forks","keys_url":"https://api.github.com/repos/umohnani8/image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/umohnani8/image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/umohnani8/image/teams","hooks_url":"https://api.github.com/repos/umohnani8/image/hooks","issue_events_url":"https://api.github.com/repos/umohnani8/image/issues/events{/number}","events_url":"https://api.github.com/repos/umohnani8/image/events","assignees_url":"https://api.github.com/repos/umohnani8/image/assignees{/user}","branches_url":"https://api.github.com/repos/umohnani8/image/branches{/branch}","tags_url":"https://api.github.com/repos/umohnani8/image/tags","blobs_url":"https://api.github.com/repos/umohnani8/image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/umohnani8/image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/umohnani8/image/git/refs{/sha}","trees_url":"https://api.github.com/repos/umohnani8/image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/umohnani8/image/statuses/{sha}","languages_url":"https://api.github.com/repos/umohnani8/image/languages","stargazers_url":"https://api.github.com/repos/umohnani8/image/stargazers","contributors_url":"https://api.github.com/repos/umohnani8/image/contributors","subscribers_url":"https://api.github.com/repos/umohnani8/image/subscribers","subscription_url":"https://api.github.com/repos/umohnani8/image/subscription","commits_url":"https://api.github.com/repos/umohnani8/image/commits{/sha}","git_commits_url":"https://api.github.com/repos/umohnani8/image/git/commits{/sha}","comments_url":"https://api.github.com/repos/umohnani8/image/comments{/number}","issue_comment_url":"https://api.github.com/repos/umohnani8/image/issues/comments{/number}","contents_url":"https://api.github.com/repos/umohnani8/image/contents/{+path}","compare_url":"https://api.github.com/repos/umohnani8/image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/umohnani8/image/merges","archive_url":"https://api.github.com/repos/umohnani8/image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/umohnani8/image/downloads","issues_url":"https://api.github.com/repos/umohnani8/image/issues{/number}","pulls_url":"https://api.github.com/repos/umohnani8/image/pulls{/number}","milestones_url":"https://api.github.com/repos/umohnani8/image/milestones{/number}","notifications_url":"https://api.github.com/repos/umohnani8/image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/umohnani8/image/labels{/name}","releases_url":"https://api.github.com/repos/umohnani8/image/releases{/id}","deployments_url":"https://api.github.com/repos/umohnani8/image/deployments","created_at":"2017-07-18T20:27:23Z","updated_at":"2017-07-18T20:27:25Z","pushed_at":"2017-07-24T13:05:02Z","git_url":"git://github.com/umohnani8/image.git","ssh_url":"git@github.com:umohnani8/image.git","clone_url":"https://github.com/umohnani8/image.git","svn_url":"https://github.com/umohnani8/image","homepage":"","size":3336,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"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":"containers:master","ref":"master","sha":"c2a797dfe5bb4a9dd7f48332ce40c6223ffba492","user":{"login":"containers","id":5874934,"avatar_url":"https://avatars3.githubusercontent.com/u/5874934?v=4","gravatar_id":"","url":"https://api.github.com/users/containers","html_url":"https://github.com/containers","followers_url":"https://api.github.com/users/containers/followers","following_url":"https://api.github.com/users/containers/following{/other_user}","gists_url":"https://api.github.com/users/containers/gists{/gist_id}","starred_url":"https://api.github.com/users/containers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containers/subscriptions","organizations_url":"https://api.github.com/users/containers/orgs","repos_url":"https://api.github.com/users/containers/repos","events_url":"https://api.github.com/users/containers/events{/privacy}","received_events_url":"https://api.github.com/users/containers/received_events","type":"Organization","site_admin":false},"repo":{"id":61739430,"name":"image","full_name":"containers/image","owner":{"login":"containers","id":5874934,"avatar_url":"https://avatars3.githubusercontent.com/u/5874934?v=4","gravatar_id":"","url":"https://api.github.com/users/containers","html_url":"https://github.com/containers","followers_url":"https://api.github.com/users/containers/followers","following_url":"https://api.github.com/users/containers/following{/other_user}","gists_url":"https://api.github.com/users/containers/gists{/gist_id}","starred_url":"https://api.github.com/users/containers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containers/subscriptions","organizations_url":"https://api.github.com/users/containers/orgs","repos_url":"https://api.github.com/users/containers/repos","events_url":"https://api.github.com/users/containers/events{/privacy}","received_events_url":"https://api.github.com/users/containers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/containers/image","description":"Work with containers' images","fork":false,"url":"https://api.github.com/repos/containers/image","forks_url":"https://api.github.com/repos/containers/image/forks","keys_url":"https://api.github.com/repos/containers/image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/containers/image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/containers/image/teams","hooks_url":"https://api.github.com/repos/containers/image/hooks","issue_events_url":"https://api.github.com/repos/containers/image/issues/events{/number}","events_url":"https://api.github.com/repos/containers/image/events","assignees_url":"https://api.github.com/repos/containers/image/assignees{/user}","branches_url":"https://api.github.com/repos/containers/image/branches{/branch}","tags_url":"https://api.github.com/repos/containers/image/tags","blobs_url":"https://api.github.com/repos/containers/image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/containers/image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/containers/image/git/refs{/sha}","trees_url":"https://api.github.com/repos/containers/image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/containers/image/statuses/{sha}","languages_url":"https://api.github.com/repos/containers/image/languages","stargazers_url":"https://api.github.com/repos/containers/image/stargazers","contributors_url":"https://api.github.com/repos/containers/image/contributors","subscribers_url":"https://api.github.com/repos/containers/image/subscribers","subscription_url":"https://api.github.com/repos/containers/image/subscription","commits_url":"https://api.github.com/repos/containers/image/commits{/sha}","git_commits_url":"https://api.github.com/repos/containers/image/git/commits{/sha}","comments_url":"https://api.github.com/repos/containers/image/comments{/number}","issue_comment_url":"https://api.github.com/repos/containers/image/issues/comments{/number}","contents_url":"https://api.github.com/repos/containers/image/contents/{+path}","compare_url":"https://api.github.com/repos/containers/image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/containers/image/merges","archive_url":"https://api.github.com/repos/containers/image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/containers/image/downloads","issues_url":"https://api.github.com/repos/containers/image/issues{/number}","pulls_url":"https://api.github.com/repos/containers/image/pulls{/number}","milestones_url":"https://api.github.com/repos/containers/image/milestones{/number}","notifications_url":"https://api.github.com/repos/containers/image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/containers/image/labels{/name}","releases_url":"https://api.github.com/repos/containers/image/releases{/id}","deployments_url":"https://api.github.com/repos/containers/image/deployments","created_at":"2016-06-22T17:46:41Z","updated_at":"2017-07-19T17:11:14Z","pushed_at":"2017-07-24T13:05:03Z","git_url":"git://github.com/containers/image.git","ssh_url":"git@github.com:containers/image.git","clone_url":"https://github.com/containers/image.git","svn_url":"https://github.com/containers/image","homepage":"","size":3335,"stargazers_count":82,"watchers_count":82,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":42,"mirror_url":null,"open_issues_count":44,"forks":42,"open_issues":44,"watchers":82,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/containers/image/pulls/313"},"html":{"href":"https://github.com/containers/image/pull/313"},"issue":{"href":"https://api.github.com/repos/containers/image/issues/313"},"comments":{"href":"https://api.github.com/repos/containers/image/issues/313/comments"},"review_comments":{"href":"https://api.github.com/repos/containers/image/pulls/313/comments"},"review_comment":{"href":"https://api.github.com/repos/containers/image/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/containers/image/pulls/313/commits"},"statuses":{"href":"https://api.github.com/repos/containers/image/statuses/2a1601f067ed9fe350afdeded26326b24491d256"}}}}
{"actor":{"display_login":"umohnani8"}}