{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin/pulls/comments/31658657","id":31658657,"diff_hunk":"@@ -106,6 +106,59 @@ func NewCmdNewApplication(fullName string, f *clientcmd.Factory, out io.Writer)\n \n // RunNewApplication contains all the necessary functionality for the OpenShift cli new-app command\n func RunNewApplication(f *clientcmd.Factory, out io.Writer, c *cobra.Command, args []string, config *newcmd.AppConfig) error {\n+\tif err := parseParameters(f, c, args, config); err != nil {\n+\t\treturn err\n+\t}\n+\n+\tresult, err := config.RunAll(out)\n+\tif err != nil {\n+\t\tif errs, ok := err.(errors.Aggregate); ok {\n+\t\t\tif len(errs.Errors()) == 1 {\n+\t\t\t\terr = errs.Errors()[0]\n+\t\t\t}\n+\t\t}\n+\t\tif err == newcmd.ErrNoInputs {\n+\t\t\t// TODO: suggest things to the user\n+\t\t\treturn cmdutil.UsageError(c, \"You must specify one or more images, image streams, templates or source code locations to create an application.\")\n+\t\t}\n+\t\treturn err\n+\t}\n+\n+\tif err := parseLabels(c, result); err != nil {\n+\t\treturn err\n+\t}\n+\tif len(cmdutil.GetFlagString(c, \"output\")) != 0 {\n+\t\treturn f.Factory.PrintObject(c, result.List, out)\n+\t}\n+\tif err := produceOutput(f, out, result); err != nil {\n+\t\treturn err\n+\t}\n+\n+\thasMissingRepo := false\n+\tfor _, item := range result.List.Items {\n+\t\tswitch t := item.(type) {\n+\t\tcase *kapi.Service:\n+\t\t\tportMappings := \".\"\n+\t\t\tif len(t.Spec.Ports) > 0 {\n+\t\t\t\tportMappings = fmt.Sprintf(\" with port mappings %s.\", describeServicePorts(t.Spec))\n+\t\t\t}\n+\t\t\tfmt.Fprintf(c.Out(), \"Service %q created at %s%s\\n\", t.Name, t.Spec.PortalIP, portMappings)\n+\t\tcase *buildapi.BuildConfig:\n+\t\t\tfmt.Fprintf(c.Out(), \"A build was created - you can run `osc start-build %s` to start it.\\n\", t.Name)\n+\t\tcase *imageapi.ImageStream:\n+\t\t\tif len(t.Status.DockerImageRepository) == 0 {\n+\t\t\t\tif hasMissingRepo {\n+\t\t\t\t\tcontinue\n+\t\t\t\t}\n+\t\t\t\thasMissingRepo = true\n+\t\t\t\tfmt.Fprintf(c.Out(), \"WARNING: We created an ImageStream %q, but it does not look like a Docker registry has been integrated with the OpenShift server. Automatic builds and deployments depend on that integration to detect new images and will not function properly.\\n\", t.Name)\n+\t\t\t}\n+\t\t}\n+\t}\n+\treturn nil\n+}\n+\n+func parseParameters(f *clientcmd.Factory, c *cobra.Command, args []string, config *newcmd.AppConfig) error {","path":"pkg/cmd/cli/cmd/newapp.go","position":75,"original_position":75,"commit_id":"8d78ac293c5551a107974a42b9358c46aed26fef","original_commit_id":"8d78ac293c5551a107974a42b9358c46aed26fef","user":{"login":"csrwng","id":5834976,"avatar_url":"https://avatars.githubusercontent.com/u/5834976?v=3","gravatar_id":"","url":"https://api.github.com/users/csrwng","html_url":"https://github.com/csrwng","followers_url":"https://api.github.com/users/csrwng/followers","following_url":"https://api.github.com/users/csrwng/following{/other_user}","gists_url":"https://api.github.com/users/csrwng/gists{/gist_id}","starred_url":"https://api.github.com/users/csrwng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csrwng/subscriptions","organizations_url":"https://api.github.com/users/csrwng/orgs","repos_url":"https://api.github.com/users/csrwng/repos","events_url":"https://api.github.com/users/csrwng/events{/privacy}","received_events_url":"https://api.github.com/users/csrwng/received_events","type":"User","site_admin":false},"body":"setupAppConfig","created_at":"2015-06-03T19:10:09Z","updated_at":"2015-06-03T19:10:09Z","html_url":"https://github.com/openshift/origin/pull/2747#discussion_r31658657","pull_request_url":"https://api.github.com/repos/openshift/origin/pulls/2747","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments/31658657"},"html":{"href":"https://github.com/openshift/origin/pull/2747#discussion_r31658657"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin/pulls/2747"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/2747","id":36853542,"html_url":"https://github.com/openshift/origin/pull/2747","diff_url":"https://github.com/openshift/origin/pull/2747.diff","patch_url":"https://github.com/openshift/origin/pull/2747.patch","issue_url":"https://api.github.com/repos/openshift/origin/issues/2747","number":2747,"state":"open","locked":false,"title":"new-build command for creating BuildConfigs","user":{"login":"soltysh","id":576341,"avatar_url":"https://avatars.githubusercontent.com/u/576341?v=3","gravatar_id":"","url":"https://api.github.com/users/soltysh","html_url":"https://github.com/soltysh","followers_url":"https://api.github.com/users/soltysh/followers","following_url":"https://api.github.com/users/soltysh/following{/other_user}","gists_url":"https://api.github.com/users/soltysh/gists{/gist_id}","starred_url":"https://api.github.com/users/soltysh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soltysh/subscriptions","organizations_url":"https://api.github.com/users/soltysh/orgs","repos_url":"https://api.github.com/users/soltysh/repos","events_url":"https://api.github.com/users/soltysh/events{/privacy}","received_events_url":"https://api.github.com/users/soltysh/received_events","type":"User","site_admin":false},"body":"This should fix #2695.\r\n@smarterclayton @csrwng ptal\r\n\r\nThis PR also includes a fix (2nd commit) for the case when generating new-app/new-build from repo containing Dockerfile (eg. https://github.com/openshift/ruby-hello-world) with forced build type (`--build=source`), previously that always created dockerStrategy.\r\n","created_at":"2015-06-03T16:52:12Z","updated_at":"2015-06-03T19:10:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a5f84aa6c2bd18da80fed1a7918be783d574756","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin/pulls/2747/commits","review_comments_url":"https://api.github.com/repos/openshift/origin/pulls/2747/comments","review_comment_url":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin/issues/2747/comments","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/8d78ac293c5551a107974a42b9358c46aed26fef","head":{"label":"soltysh:new-build","ref":"new-build","sha":"8d78ac293c5551a107974a42b9358c46aed26fef","user":{"login":"soltysh","id":576341,"avatar_url":"https://avatars.githubusercontent.com/u/576341?v=3","gravatar_id":"","url":"https://api.github.com/users/soltysh","html_url":"https://github.com/soltysh","followers_url":"https://api.github.com/users/soltysh/followers","following_url":"https://api.github.com/users/soltysh/following{/other_user}","gists_url":"https://api.github.com/users/soltysh/gists{/gist_id}","starred_url":"https://api.github.com/users/soltysh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soltysh/subscriptions","organizations_url":"https://api.github.com/users/soltysh/orgs","repos_url":"https://api.github.com/users/soltysh/repos","events_url":"https://api.github.com/users/soltysh/events{/privacy}","received_events_url":"https://api.github.com/users/soltysh/received_events","type":"User","site_admin":false},"repo":{"id":22954476,"name":"origin","full_name":"soltysh/origin","owner":{"login":"soltysh","id":576341,"avatar_url":"https://avatars.githubusercontent.com/u/576341?v=3","gravatar_id":"","url":"https://api.github.com/users/soltysh","html_url":"https://github.com/soltysh","followers_url":"https://api.github.com/users/soltysh/followers","following_url":"https://api.github.com/users/soltysh/following{/other_user}","gists_url":"https://api.github.com/users/soltysh/gists{/gist_id}","starred_url":"https://api.github.com/users/soltysh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soltysh/subscriptions","organizations_url":"https://api.github.com/users/soltysh/orgs","repos_url":"https://api.github.com/users/soltysh/repos","events_url":"https://api.github.com/users/soltysh/events{/privacy}","received_events_url":"https://api.github.com/users/soltysh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/soltysh/origin","description":"OpenShift 3 - build, deploy, and manage your applications with Docker and Kubernetes","fork":true,"url":"https://api.github.com/repos/soltysh/origin","forks_url":"https://api.github.com/repos/soltysh/origin/forks","keys_url":"https://api.github.com/repos/soltysh/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/soltysh/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/soltysh/origin/teams","hooks_url":"https://api.github.com/repos/soltysh/origin/hooks","issue_events_url":"https://api.github.com/repos/soltysh/origin/issues/events{/number}","events_url":"https://api.github.com/repos/soltysh/origin/events","assignees_url":"https://api.github.com/repos/soltysh/origin/assignees{/user}","branches_url":"https://api.github.com/repos/soltysh/origin/branches{/branch}","tags_url":"https://api.github.com/repos/soltysh/origin/tags","blobs_url":"https://api.github.com/repos/soltysh/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/soltysh/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/soltysh/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/soltysh/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/soltysh/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/soltysh/origin/languages","stargazers_url":"https://api.github.com/repos/soltysh/origin/stargazers","contributors_url":"https://api.github.com/repos/soltysh/origin/contributors","subscribers_url":"https://api.github.com/repos/soltysh/origin/subscribers","subscription_url":"https://api.github.com/repos/soltysh/origin/subscription","commits_url":"https://api.github.com/repos/soltysh/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/soltysh/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/soltysh/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/soltysh/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/soltysh/origin/contents/{+path}","compare_url":"https://api.github.com/repos/soltysh/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/soltysh/origin/merges","archive_url":"https://api.github.com/repos/soltysh/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/soltysh/origin/downloads","issues_url":"https://api.github.com/repos/soltysh/origin/issues{/number}","pulls_url":"https://api.github.com/repos/soltysh/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/soltysh/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/soltysh/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/soltysh/origin/labels{/name}","releases_url":"https://api.github.com/repos/soltysh/origin/releases{/id}","created_at":"2014-08-14T13:19:11Z","updated_at":"2015-05-08T12:30:59Z","pushed_at":"2015-06-03T18:52:43Z","git_url":"git://github.com/soltysh/origin.git","ssh_url":"git@github.com:soltysh/origin.git","clone_url":"https://github.com/soltysh/origin.git","svn_url":"https://github.com/soltysh/origin","homepage":"https://openshift.github.io","size":110722,"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":"d5a07c1c20c90969442852891c3a1a65cbf0fbdf","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 3 - build, deploy, and manage your applications with Docker and Kubernetes","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}","created_at":"2014-07-30T20:04:05Z","updated_at":"2015-06-03T15:05:31Z","pushed_at":"2015-06-03T19:06:41Z","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":179091,"stargazers_count":455,"watchers_count":455,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":227,"mirror_url":null,"open_issues_count":315,"forks":227,"open_issues":315,"watchers":455,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/2747"},"html":{"href":"https://github.com/openshift/origin/pull/2747"},"issue":{"href":"https://api.github.com/repos/openshift/origin/issues/2747"},"comments":{"href":"https://api.github.com/repos/openshift/origin/issues/2747/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin/pulls/2747/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin/pulls/2747/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin/statuses/8d78ac293c5551a107974a42b9358c46aed26fef"}}}}