{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/comments/93665286","pull_request_review_id":14198059,"id":93665286,"diff_hunk":"@@ -17,40 +17,53 @@ limitations under the License.\n package util\n \n import (\n-\t\"encoding/json\"\n-\n \tsbmodel \"github.com/kubernetes-incubator/service-catalog/model/service_broker\"\n-\tscmodel \"github.com/kubernetes-incubator/service-catalog/model/service_controller\"\n+\t\"github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog\"\n )\n \n // ConvertCredential converts a Credential object from the broker model to the\n // controller model.\n-func ConvertCredential(in *sbmodel.Credential) (*scmodel.Credential, error) {\n-\tj, err := json.Marshal(in)\n-\tif err != nil {\n-\t\treturn nil, err\n-\t}\n+// func ConvertCredential(in *sbmodel.Credential) (*servicecatalog.BindingSpec, error) {\n+// \tj, err := json.Marshal(in)\n+// \tif err != nil {\n+// \t\treturn nil, err\n+// \t}\n+//\n+// \tout := &scmodel.Credential{}\n+// \tif err := json.Unmarshal([]byte(j), out); err != nil {\n+// \t\treturn nil, err\n+// \t}\n+//\n+// \treturn out, nil\n+// }\n \n-\tout := &scmodel.Credential{}\n-\tif err := json.Unmarshal([]byte(j), out); err != nil {\n-\t\treturn nil, err\n+func convertServicePlans(plans []sbmodel.ServicePlan) []servicecatalog.ServicePlan {\n+\tret := make([]servicecatalog.ServicePlan, len(plans))\n+\tfor i, plan := range plans {\n+\t\tret[i] = servicecatalog.ServicePlan{\n+\t\t\tName:       plan.Name,\n+\t\t\tCFGUID:     plan.ID,\n+\t\t\tCFMetadata: plan.Metadata,\n+\t\t\tCFFree:     plan.Free,\n+\t\t}\n \t}\n-\n-\treturn out, nil\n+\treturn ret\n }\n \n-// ConvertCatalog converts a Catalog object from the broker model to the\n-// controller model.\n-func ConvertCatalog(in *sbmodel.Catalog) (*scmodel.Catalog, error) {\n-\tj, err := json.Marshal(in)\n-\tif err != nil {\n-\t\treturn nil, err\n+// ConvertCatalog converts a service broker catalog into an array of ServiceClasses","path":"pkg/controller/catalog/util/converter.go","position":56,"original_position":56,"commit_id":"5281cd13ec5b275f85ddb2c13e661cb7497fc3af","original_commit_id":"5281cd13ec5b275f85ddb2c13e661cb7497fc3af","user":{"login":"duglin","id":1944671,"avatar_url":"https://avatars.githubusercontent.com/u/1944671?v=3","gravatar_id":"","url":"https://api.github.com/users/duglin","html_url":"https://github.com/duglin","followers_url":"https://api.github.com/users/duglin/followers","following_url":"https://api.github.com/users/duglin/following{/other_user}","gists_url":"https://api.github.com/users/duglin/gists{/gist_id}","starred_url":"https://api.github.com/users/duglin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duglin/subscriptions","organizations_url":"https://api.github.com/users/duglin/orgs","repos_url":"https://api.github.com/users/duglin/repos","events_url":"https://api.github.com/users/duglin/events{/privacy}","received_events_url":"https://api.github.com/users/duglin/received_events","type":"User","site_admin":false},"body":"yea my comment wasn't so much about this PR as much as its about the original placement in here :-)  However, I wouldn't object to it being moved as part of this PR. Otherwise, if I remember, I'll do it in a follow-on PR.","created_at":"2016-12-22T17:32:58Z","updated_at":"2016-12-22T17:32:58Z","html_url":"https://github.com/kubernetes-incubator/service-catalog/pull/176#discussion_r93665286","pull_request_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/176","_links":{"self":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/comments/93665286"},"html":{"href":"https://github.com/kubernetes-incubator/service-catalog/pull/176#discussion_r93665286"},"pull_request":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/176"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/176","id":98259168,"html_url":"https://github.com/kubernetes-incubator/service-catalog/pull/176","diff_url":"https://github.com/kubernetes-incubator/service-catalog/pull/176.diff","patch_url":"https://github.com/kubernetes-incubator/service-catalog/pull/176.patch","issue_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/176","number":176,"state":"open","locked":false,"title":"Removing the ./models/service_controller package","user":{"login":"arschles","id":70865,"avatar_url":"https://avatars.githubusercontent.com/u/70865?v=3","gravatar_id":"","url":"https://api.github.com/users/arschles","html_url":"https://github.com/arschles","followers_url":"https://api.github.com/users/arschles/followers","following_url":"https://api.github.com/users/arschles/following{/other_user}","gists_url":"https://api.github.com/users/arschles/gists{/gist_id}","starred_url":"https://api.github.com/users/arschles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arschles/subscriptions","organizations_url":"https://api.github.com/users/arschles/orgs","repos_url":"https://api.github.com/users/arschles/repos","events_url":"https://api.github.com/users/arschles/events{/privacy}","received_events_url":"https://api.github.com/users/arschles/received_events","type":"User","site_admin":false},"body":"Removal requires a large amount of refactoring.\r\n\r\nTODO in a follow-up PR: change the package structure `./model/service_broker` to `./sbapi` and rename that Go package to `sbapi`\r\n\r\nFixes #127","created_at":"2016-12-16T00:37:08Z","updated_at":"2016-12-22T17:32:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5262c869c332c15fc80079c347050db3125673e","assignee":{"login":"arschles","id":70865,"avatar_url":"https://avatars.githubusercontent.com/u/70865?v=3","gravatar_id":"","url":"https://api.github.com/users/arschles","html_url":"https://github.com/arschles","followers_url":"https://api.github.com/users/arschles/followers","following_url":"https://api.github.com/users/arschles/following{/other_user}","gists_url":"https://api.github.com/users/arschles/gists{/gist_id}","starred_url":"https://api.github.com/users/arschles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arschles/subscriptions","organizations_url":"https://api.github.com/users/arschles/orgs","repos_url":"https://api.github.com/users/arschles/repos","events_url":"https://api.github.com/users/arschles/events{/privacy}","received_events_url":"https://api.github.com/users/arschles/received_events","type":"User","site_admin":false},"assignees":[{"login":"arschles","id":70865,"avatar_url":"https://avatars.githubusercontent.com/u/70865?v=3","gravatar_id":"","url":"https://api.github.com/users/arschles","html_url":"https://github.com/arschles","followers_url":"https://api.github.com/users/arschles/followers","following_url":"https://api.github.com/users/arschles/following{/other_user}","gists_url":"https://api.github.com/users/arschles/gists{/gist_id}","starred_url":"https://api.github.com/users/arschles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arschles/subscriptions","organizations_url":"https://api.github.com/users/arschles/orgs","repos_url":"https://api.github.com/users/arschles/repos","events_url":"https://api.github.com/users/arschles/events{/privacy}","received_events_url":"https://api.github.com/users/arschles/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/176/commits","review_comments_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/176/comments","review_comment_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/176/comments","statuses_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/statuses/5281cd13ec5b275f85ddb2c13e661cb7497fc3af","head":{"label":"arschles:rm-models","ref":"rm-models","sha":"5281cd13ec5b275f85ddb2c13e661cb7497fc3af","user":{"login":"arschles","id":70865,"avatar_url":"https://avatars.githubusercontent.com/u/70865?v=3","gravatar_id":"","url":"https://api.github.com/users/arschles","html_url":"https://github.com/arschles","followers_url":"https://api.github.com/users/arschles/followers","following_url":"https://api.github.com/users/arschles/following{/other_user}","gists_url":"https://api.github.com/users/arschles/gists{/gist_id}","starred_url":"https://api.github.com/users/arschles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arschles/subscriptions","organizations_url":"https://api.github.com/users/arschles/orgs","repos_url":"https://api.github.com/users/arschles/repos","events_url":"https://api.github.com/users/arschles/events{/privacy}","received_events_url":"https://api.github.com/users/arschles/received_events","type":"User","site_admin":false},"repo":{"id":70734213,"name":"kubernetes-incubator-service-catalog","full_name":"arschles/kubernetes-incubator-service-catalog","owner":{"login":"arschles","id":70865,"avatar_url":"https://avatars.githubusercontent.com/u/70865?v=3","gravatar_id":"","url":"https://api.github.com/users/arschles","html_url":"https://github.com/arschles","followers_url":"https://api.github.com/users/arschles/followers","following_url":"https://api.github.com/users/arschles/following{/other_user}","gists_url":"https://api.github.com/users/arschles/gists{/gist_id}","starred_url":"https://api.github.com/users/arschles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arschles/subscriptions","organizations_url":"https://api.github.com/users/arschles/orgs","repos_url":"https://api.github.com/users/arschles/repos","events_url":"https://api.github.com/users/arschles/events{/privacy}","received_events_url":"https://api.github.com/users/arschles/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/arschles/kubernetes-incubator-service-catalog","description":"Share and consume services in Kubernetes using service brokers","fork":true,"url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog","forks_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/forks","keys_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/teams","hooks_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/hooks","issue_events_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/issues/events{/number}","events_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/events","assignees_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/assignees{/user}","branches_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/branches{/branch}","tags_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/tags","blobs_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/git/refs{/sha}","trees_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/statuses/{sha}","languages_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/languages","stargazers_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/stargazers","contributors_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/contributors","subscribers_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/subscribers","subscription_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/subscription","commits_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/commits{/sha}","git_commits_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/git/commits{/sha}","comments_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/comments{/number}","issue_comment_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/issues/comments{/number}","contents_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/contents/{+path}","compare_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/merges","archive_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/downloads","issues_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/issues{/number}","pulls_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/pulls{/number}","milestones_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/milestones{/number}","notifications_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/labels{/name}","releases_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/releases{/id}","deployments_url":"https://api.github.com/repos/arschles/kubernetes-incubator-service-catalog/deployments","created_at":"2016-10-12T19:28:49Z","updated_at":"2016-10-12T19:29:01Z","pushed_at":"2016-12-21T20:48:47Z","git_url":"git://github.com/arschles/kubernetes-incubator-service-catalog.git","ssh_url":"git@github.com:arschles/kubernetes-incubator-service-catalog.git","clone_url":"https://github.com/arschles/kubernetes-incubator-service-catalog.git","svn_url":"https://github.com/arschles/kubernetes-incubator-service-catalog","homepage":"","size":39645,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"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":"kubernetes-incubator:master","ref":"master","sha":"80c0103ae91223bc773c49d3b7f75b01a35af036","user":{"login":"kubernetes-incubator","id":20862812,"avatar_url":"https://avatars.githubusercontent.com/u/20862812?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes-incubator","html_url":"https://github.com/kubernetes-incubator","followers_url":"https://api.github.com/users/kubernetes-incubator/followers","following_url":"https://api.github.com/users/kubernetes-incubator/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes-incubator/subscriptions","organizations_url":"https://api.github.com/users/kubernetes-incubator/orgs","repos_url":"https://api.github.com/users/kubernetes-incubator/repos","events_url":"https://api.github.com/users/kubernetes-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":68024288,"name":"service-catalog","full_name":"kubernetes-incubator/service-catalog","owner":{"login":"kubernetes-incubator","id":20862812,"avatar_url":"https://avatars.githubusercontent.com/u/20862812?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes-incubator","html_url":"https://github.com/kubernetes-incubator","followers_url":"https://api.github.com/users/kubernetes-incubator/followers","following_url":"https://api.github.com/users/kubernetes-incubator/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes-incubator/subscriptions","organizations_url":"https://api.github.com/users/kubernetes-incubator/orgs","repos_url":"https://api.github.com/users/kubernetes-incubator/repos","events_url":"https://api.github.com/users/kubernetes-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes-incubator/service-catalog","description":"Share and consume services in Kubernetes using service brokers","fork":false,"url":"https://api.github.com/repos/kubernetes-incubator/service-catalog","forks_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/forks","keys_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/teams","hooks_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/hooks","issue_events_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/events","assignees_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/tags","blobs_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/languages","stargazers_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/stargazers","contributors_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/contributors","subscribers_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/subscribers","subscription_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/subscription","commits_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/merges","archive_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/downloads","issues_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/deployments","created_at":"2016-09-12T15:58:39Z","updated_at":"2016-12-21T12:14:09Z","pushed_at":"2016-12-22T02:37:02Z","git_url":"git://github.com/kubernetes-incubator/service-catalog.git","ssh_url":"git@github.com:kubernetes-incubator/service-catalog.git","clone_url":"https://github.com/kubernetes-incubator/service-catalog.git","svn_url":"https://github.com/kubernetes-incubator/service-catalog","homepage":"","size":39542,"stargazers_count":40,"watchers_count":40,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":56,"forks":24,"open_issues":56,"watchers":40,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/176"},"html":{"href":"https://github.com/kubernetes-incubator/service-catalog/pull/176"},"issue":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/176"},"comments":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/176/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/176/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/176/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/statuses/5281cd13ec5b275f85ddb2c13e661cb7497fc3af"}}}}
{"actor":{"display_login":"duglin"}}