{"action":"created","comment":{"url":"https://api.github.com/repos/coreos/ignition/pulls/comments/37217343","id":37217343,"diff_hunk":"@@ -141,3 +128,62 @@ func parseCmdline(cmdline []byte) (url string) {\n \n \treturn\n }\n+\n+// getRawConfig gets the raw configuration data from p.configUrl.\n+// Supported URL schemes are:\n+// http://\tremote resource accessed via http\n+// oem://\tlocal file in /usr/share/oem\n+func (p *provider) getRawConfig() bool {\n+\turl, err := url.Parse(p.configUrl)\n+\tif err != nil {\n+\t\tp.logger.Err(\"failed to parse url: %v\", err)\n+\t\treturn false\n+\t}\n+\n+\tswitch url.Scheme {\n+\tcase \"http\":\n+\t\tif resp, err := p.client.Get(p.configUrl); err == nil {\n+\t\t\tdefer resp.Body.Close()\n+\n+\t\t\tswitch resp.StatusCode {\n+\t\t\tcase http.StatusOK, http.StatusNoContent:\n+\t\t\tdefault:\n+\t\t\t\tp.logger.Debug(\"failed fetching: HTTP status: %s\", resp.Status)\n+\t\t\t\treturn false\n+\t\t\t}\n+\n+\t\t\tp.logger.Debug(\"successfully fetched\")\n+\t\t\tif p.rawConfig, err = ioutil.ReadAll(resp.Body); err != nil {\n+\t\t\t\tp.logger.Err(\"failed to read body: %v\", err)\n+\t\t\t\treturn false\n+\t\t\t}\n+\t\t} else {\n+\t\t\tp.logger.Warning(\"failed fetching: %v\", err)\n+\t\t}\n+\tcase \"oem\":\n+\t\tpath := filepath.Clean(url.Path)\n+\t\tif !filepath.IsAbs(path) {\n+\t\t\tp.logger.Err(\"oem path is not absolute: %q\", url.Path)\n+\t\t\treturn false\n+\t\t}\n+\n+\t\tgetPath := func(which string) string {\n+\t\t\treturn fmt.Sprintf(\"%s/%s\", which, path)","path":"src/providers/cmdline/cmdline.go","position":95,"original_position":95,"commit_id":"5f3ba256ecc298ae490c13beeb759362c3f4b1d9","original_commit_id":"5f3ba256ecc298ae490c13beeb759362c3f4b1d9","user":{"login":"crawford","id":368848,"avatar_url":"https://avatars.githubusercontent.com/u/368848?v=3","gravatar_id":"","url":"https://api.github.com/users/crawford","html_url":"https://github.com/crawford","followers_url":"https://api.github.com/users/crawford/followers","following_url":"https://api.github.com/users/crawford/following{/other_user}","gists_url":"https://api.github.com/users/crawford/gists{/gist_id}","starred_url":"https://api.github.com/users/crawford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crawford/subscriptions","organizations_url":"https://api.github.com/users/crawford/orgs","repos_url":"https://api.github.com/users/crawford/repos","events_url":"https://api.github.com/users/crawford/events{/privacy}","received_events_url":"https://api.github.com/users/crawford/received_events","type":"User","site_admin":false},"body":"```go\r\nfilepath.Join(which, path)\r\n```","created_at":"2015-08-17T18:06:48Z","updated_at":"2015-08-17T18:06:48Z","html_url":"https://github.com/coreos/ignition/pull/111#discussion_r37217343","pull_request_url":"https://api.github.com/repos/coreos/ignition/pulls/111","_links":{"self":{"href":"https://api.github.com/repos/coreos/ignition/pulls/comments/37217343"},"html":{"href":"https://github.com/coreos/ignition/pull/111#discussion_r37217343"},"pull_request":{"href":"https://api.github.com/repos/coreos/ignition/pulls/111"}}},"pull_request":{"url":"https://api.github.com/repos/coreos/ignition/pulls/111","id":42518793,"html_url":"https://github.com/coreos/ignition/pull/111","diff_url":"https://github.com/coreos/ignition/pull/111.diff","patch_url":"https://github.com/coreos/ignition/pull/111.patch","issue_url":"https://api.github.com/repos/coreos/ignition/issues/111","number":111,"state":"open","locked":false,"title":"providers/cmdline: support oem:// url scheme","user":{"login":"vcaputo","id":1452963,"avatar_url":"https://avatars.githubusercontent.com/u/1452963?v=3","gravatar_id":"","url":"https://api.github.com/users/vcaputo","html_url":"https://github.com/vcaputo","followers_url":"https://api.github.com/users/vcaputo/followers","following_url":"https://api.github.com/users/vcaputo/following{/other_user}","gists_url":"https://api.github.com/users/vcaputo/gists{/gist_id}","starred_url":"https://api.github.com/users/vcaputo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vcaputo/subscriptions","organizations_url":"https://api.github.com/users/vcaputo/orgs","repos_url":"https://api.github.com/users/vcaputo/repos","events_url":"https://api.github.com/users/vcaputo/events{/privacy}","received_events_url":"https://api.github.com/users/vcaputo/received_events","type":"User","site_admin":false},"body":"Looks for the supplied path in /mnt/oem and /sysroot/usr/share/oem\r\nwhen oem:// is used as the scheme instead of http://.\r\n\r\nFixes #110","created_at":"2015-08-15T12:45:11Z","updated_at":"2015-08-17T18:06:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ff1d13c3f34d6166f72bb7e04a9a7323da2713d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/coreos/ignition/pulls/111/commits","review_comments_url":"https://api.github.com/repos/coreos/ignition/pulls/111/comments","review_comment_url":"https://api.github.com/repos/coreos/ignition/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coreos/ignition/issues/111/comments","statuses_url":"https://api.github.com/repos/coreos/ignition/statuses/5f3ba256ecc298ae490c13beeb759362c3f4b1d9","head":{"label":"vcaputo:oem_url","ref":"oem_url","sha":"5f3ba256ecc298ae490c13beeb759362c3f4b1d9","user":{"login":"vcaputo","id":1452963,"avatar_url":"https://avatars.githubusercontent.com/u/1452963?v=3","gravatar_id":"","url":"https://api.github.com/users/vcaputo","html_url":"https://github.com/vcaputo","followers_url":"https://api.github.com/users/vcaputo/followers","following_url":"https://api.github.com/users/vcaputo/following{/other_user}","gists_url":"https://api.github.com/users/vcaputo/gists{/gist_id}","starred_url":"https://api.github.com/users/vcaputo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vcaputo/subscriptions","organizations_url":"https://api.github.com/users/vcaputo/orgs","repos_url":"https://api.github.com/users/vcaputo/repos","events_url":"https://api.github.com/users/vcaputo/events{/privacy}","received_events_url":"https://api.github.com/users/vcaputo/received_events","type":"User","site_admin":false},"repo":{"id":33337092,"name":"ignition","full_name":"vcaputo/ignition","owner":{"login":"vcaputo","id":1452963,"avatar_url":"https://avatars.githubusercontent.com/u/1452963?v=3","gravatar_id":"","url":"https://api.github.com/users/vcaputo","html_url":"https://github.com/vcaputo","followers_url":"https://api.github.com/users/vcaputo/followers","following_url":"https://api.github.com/users/vcaputo/following{/other_user}","gists_url":"https://api.github.com/users/vcaputo/gists{/gist_id}","starred_url":"https://api.github.com/users/vcaputo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vcaputo/subscriptions","organizations_url":"https://api.github.com/users/vcaputo/orgs","repos_url":"https://api.github.com/users/vcaputo/repos","events_url":"https://api.github.com/users/vcaputo/events{/privacy}","received_events_url":"https://api.github.com/users/vcaputo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vcaputo/ignition","description":"","fork":true,"url":"https://api.github.com/repos/vcaputo/ignition","forks_url":"https://api.github.com/repos/vcaputo/ignition/forks","keys_url":"https://api.github.com/repos/vcaputo/ignition/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vcaputo/ignition/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vcaputo/ignition/teams","hooks_url":"https://api.github.com/repos/vcaputo/ignition/hooks","issue_events_url":"https://api.github.com/repos/vcaputo/ignition/issues/events{/number}","events_url":"https://api.github.com/repos/vcaputo/ignition/events","assignees_url":"https://api.github.com/repos/vcaputo/ignition/assignees{/user}","branches_url":"https://api.github.com/repos/vcaputo/ignition/branches{/branch}","tags_url":"https://api.github.com/repos/vcaputo/ignition/tags","blobs_url":"https://api.github.com/repos/vcaputo/ignition/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vcaputo/ignition/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vcaputo/ignition/git/refs{/sha}","trees_url":"https://api.github.com/repos/vcaputo/ignition/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vcaputo/ignition/statuses/{sha}","languages_url":"https://api.github.com/repos/vcaputo/ignition/languages","stargazers_url":"https://api.github.com/repos/vcaputo/ignition/stargazers","contributors_url":"https://api.github.com/repos/vcaputo/ignition/contributors","subscribers_url":"https://api.github.com/repos/vcaputo/ignition/subscribers","subscription_url":"https://api.github.com/repos/vcaputo/ignition/subscription","commits_url":"https://api.github.com/repos/vcaputo/ignition/commits{/sha}","git_commits_url":"https://api.github.com/repos/vcaputo/ignition/git/commits{/sha}","comments_url":"https://api.github.com/repos/vcaputo/ignition/comments{/number}","issue_comment_url":"https://api.github.com/repos/vcaputo/ignition/issues/comments{/number}","contents_url":"https://api.github.com/repos/vcaputo/ignition/contents/{+path}","compare_url":"https://api.github.com/repos/vcaputo/ignition/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vcaputo/ignition/merges","archive_url":"https://api.github.com/repos/vcaputo/ignition/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vcaputo/ignition/downloads","issues_url":"https://api.github.com/repos/vcaputo/ignition/issues{/number}","pulls_url":"https://api.github.com/repos/vcaputo/ignition/pulls{/number}","milestones_url":"https://api.github.com/repos/vcaputo/ignition/milestones{/number}","notifications_url":"https://api.github.com/repos/vcaputo/ignition/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vcaputo/ignition/labels{/name}","releases_url":"https://api.github.com/repos/vcaputo/ignition/releases{/id}","created_at":"2015-04-02T23:37:54Z","updated_at":"2015-04-02T23:37:54Z","pushed_at":"2015-08-15T12:53:04Z","git_url":"git://github.com/vcaputo/ignition.git","ssh_url":"git@github.com:vcaputo/ignition.git","clone_url":"https://github.com/vcaputo/ignition.git","svn_url":"https://github.com/vcaputo/ignition","homepage":null,"size":918,"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":"coreos:master","ref":"master","sha":"41f6093552a80e8b78b769f9bca8599c8b269097","user":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"repo":{"id":33020174,"name":"ignition","full_name":"coreos/ignition","owner":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coreos/ignition","description":"","fork":false,"url":"https://api.github.com/repos/coreos/ignition","forks_url":"https://api.github.com/repos/coreos/ignition/forks","keys_url":"https://api.github.com/repos/coreos/ignition/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coreos/ignition/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coreos/ignition/teams","hooks_url":"https://api.github.com/repos/coreos/ignition/hooks","issue_events_url":"https://api.github.com/repos/coreos/ignition/issues/events{/number}","events_url":"https://api.github.com/repos/coreos/ignition/events","assignees_url":"https://api.github.com/repos/coreos/ignition/assignees{/user}","branches_url":"https://api.github.com/repos/coreos/ignition/branches{/branch}","tags_url":"https://api.github.com/repos/coreos/ignition/tags","blobs_url":"https://api.github.com/repos/coreos/ignition/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coreos/ignition/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coreos/ignition/git/refs{/sha}","trees_url":"https://api.github.com/repos/coreos/ignition/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coreos/ignition/statuses/{sha}","languages_url":"https://api.github.com/repos/coreos/ignition/languages","stargazers_url":"https://api.github.com/repos/coreos/ignition/stargazers","contributors_url":"https://api.github.com/repos/coreos/ignition/contributors","subscribers_url":"https://api.github.com/repos/coreos/ignition/subscribers","subscription_url":"https://api.github.com/repos/coreos/ignition/subscription","commits_url":"https://api.github.com/repos/coreos/ignition/commits{/sha}","git_commits_url":"https://api.github.com/repos/coreos/ignition/git/commits{/sha}","comments_url":"https://api.github.com/repos/coreos/ignition/comments{/number}","issue_comment_url":"https://api.github.com/repos/coreos/ignition/issues/comments{/number}","contents_url":"https://api.github.com/repos/coreos/ignition/contents/{+path}","compare_url":"https://api.github.com/repos/coreos/ignition/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coreos/ignition/merges","archive_url":"https://api.github.com/repos/coreos/ignition/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coreos/ignition/downloads","issues_url":"https://api.github.com/repos/coreos/ignition/issues{/number}","pulls_url":"https://api.github.com/repos/coreos/ignition/pulls{/number}","milestones_url":"https://api.github.com/repos/coreos/ignition/milestones{/number}","notifications_url":"https://api.github.com/repos/coreos/ignition/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coreos/ignition/labels{/name}","releases_url":"https://api.github.com/repos/coreos/ignition/releases{/id}","created_at":"2015-03-28T03:52:33Z","updated_at":"2015-08-09T23:25:46Z","pushed_at":"2015-08-15T12:53:04Z","git_url":"git://github.com/coreos/ignition.git","ssh_url":"git@github.com:coreos/ignition.git","clone_url":"https://github.com/coreos/ignition.git","svn_url":"https://github.com/coreos/ignition","homepage":null,"size":1131,"stargazers_count":41,"watchers_count":41,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":3,"forks":7,"open_issues":3,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coreos/ignition/pulls/111"},"html":{"href":"https://github.com/coreos/ignition/pull/111"},"issue":{"href":"https://api.github.com/repos/coreos/ignition/issues/111"},"comments":{"href":"https://api.github.com/repos/coreos/ignition/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/coreos/ignition/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/coreos/ignition/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coreos/ignition/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/coreos/ignition/statuses/5f3ba256ecc298ae490c13beeb759362c3f4b1d9"}}}}