{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/comments/96408900","pull_request_review_id":16988408,"id":96408900,"diff_hunk":"@@ -0,0 +1,119 @@\n+/*\n+Copyright 2016 The Kubernetes Authors.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+package broker\n+\n+// this was copied from where else and edited to fit our objects\n+\n+import (\n+\tkapi \"k8s.io/kubernetes/pkg/api\"\n+\t\"k8s.io/kubernetes/pkg/api/rest\"\n+\t\"k8s.io/kubernetes/pkg/runtime\"\n+\t\"k8s.io/kubernetes/pkg/util/validation/field\"\n+\n+\t\"github.com/golang/glog\"\n+\tsc \"github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog\"\n+\tscv \"github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/validation\"\n+)\n+\n+// implements interfaces RESTCreateStrategy, RESTUpdateStrategy, RESTDeleteStrategy\n+type brokerRESTStrategy struct {\n+\truntime.ObjectTyper // inherit ObjectKinds method\n+\tkapi.NameGenerator  // GenerateName method for CreateStrategy\n+}\n+\n+var (\n+\tbrokerRESTStrategies = brokerRESTStrategy{\n+\t\t// embeds to pull in existing code behavior from upstream\n+\n+\t\t// this has an interesting NOTE on it. Not sure if it applies to us.\n+\t\tObjectTyper: kapi.Scheme,\n+\t\t// use the generator from upstream k8s, or implement method\n+\t\t// `GenerateName(base string) string`\n+\t\tNameGenerator: kapi.SimpleNameGenerator,\n+\t}\n+\t_ rest.RESTCreateStrategy = brokerRESTStrategies\n+\t_ rest.RESTUpdateStrategy = brokerRESTStrategies\n+\t_ rest.RESTDeleteStrategy = brokerRESTStrategies\n+)\n+\n+// Canonicalize does not transform a broker.\n+func (brokerRESTStrategy) Canonicalize(obj runtime.Object) {\n+\t_, ok := obj.(*sc.Broker)\n+\tif !ok {\n+\t\tglog.Warning(\"received a non-broker object to create\")\n+\t}\n+}\n+\n+// NamespaceScoped returns false as brokers are not scoped to a namespace.\n+func (brokerRESTStrategy) NamespaceScoped() bool {\n+\treturn false\n+}\n+\n+// PrepareForCreate receives a the incoming Broker and clears it's\n+// Status. Status is not a user settable field.\n+func (brokerRESTStrategy) PrepareForCreate(ctx kapi.Context, obj runtime.Object) {\n+\tbroker, ok := obj.(*sc.Broker)\n+\tif !ok {\n+\t\tglog.Warning(\"received a non-broker object to create\")\n+\t}\n+\t// Is there anything to pull out of the context `ctx`?\n+\n+\t// Creating a brand new object, thus it must have no\n+\t// status. We can't fail here if they passed a status in, so\n+\t// we just wipe it clean.\n+\tbroker.Status = sc.BrokerStatus{}\n+\t// Fill in the first entry set to \"creating\"?\n+\tbroker.Status.Conditions = []sc.BrokerCondition{}\n+}\n+\n+func (brokerRESTStrategy) Validate(ctx kapi.Context, obj runtime.Object) field.ErrorList {\n+\treturn scv.ValidateBroker(obj.(*sc.Broker))\n+}\n+\n+func (brokerRESTStrategy) AllowCreateOnUpdate() bool {\n+\treturn false\n+}\n+\n+func (brokerRESTStrategy) AllowUnconditionalUpdate() bool {","path":"pkg/registry/servicecatalog/broker/strategy.go","position":91,"original_position":91,"commit_id":"de0b3fa6c9bccebf6f1db07f8b45f00f46333962","original_commit_id":"9da1dab90255e58bbba52a89d966f7c954682d94","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":"ah, to remove the E-tag-like check - gotcha.","created_at":"2017-01-17T13:23:14Z","updated_at":"2017-01-17T13:23:14Z","html_url":"https://github.com/kubernetes-incubator/service-catalog/pull/235#discussion_r96408900","pull_request_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/235","_links":{"self":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/comments/96408900"},"html":{"href":"https://github.com/kubernetes-incubator/service-catalog/pull/235#discussion_r96408900"},"pull_request":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/235"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/235","id":100738438,"html_url":"https://github.com/kubernetes-incubator/service-catalog/pull/235","diff_url":"https://github.com/kubernetes-incubator/service-catalog/pull/235.diff","patch_url":"https://github.com/kubernetes-incubator/service-catalog/pull/235.patch","issue_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/235","number":235,"state":"open","locked":false,"title":"[cut, please review] Broker Strategy impl & unit test (Based on #216)","user":{"login":"MHBauer","id":13337345,"avatar_url":"https://avatars.githubusercontent.com/u/13337345?v=3","gravatar_id":"","url":"https://api.github.com/users/MHBauer","html_url":"https://github.com/MHBauer","followers_url":"https://api.github.com/users/MHBauer/followers","following_url":"https://api.github.com/users/MHBauer/following{/other_user}","gists_url":"https://api.github.com/users/MHBauer/gists{/gist_id}","starred_url":"https://api.github.com/users/MHBauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MHBauer/subscriptions","organizations_url":"https://api.github.com/users/MHBauer/orgs","repos_url":"https://api.github.com/users/MHBauer/repos","events_url":"https://api.github.com/users/MHBauer/events{/privacy}","received_events_url":"https://api.github.com/users/MHBauer/received_events","type":"User","site_admin":false},"body":"based on #216 \r\nstub out some of the implementations of the strategy stuff for brokers. Focused only on impl for broker. Will let someone else do other objects. Collaborate and learn!\r\n\r\nHard to tell with all the base patches. I have one commit each for each of the create, delete, update. Have some design thoughts on the way these impls are created. Have some questions about project layout to follow up with.","created_at":"2017-01-09T18:46:41Z","updated_at":"2017-01-17T13:23:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2025be817c3e838486a054a8f9f9ce9bb4cc5e5c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/235/commits","review_comments_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/235/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/235/comments","statuses_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/statuses/de0b3fa6c9bccebf6f1db07f8b45f00f46333962","head":{"label":"MHBauer:based-on-216","ref":"based-on-216","sha":"de0b3fa6c9bccebf6f1db07f8b45f00f46333962","user":{"login":"MHBauer","id":13337345,"avatar_url":"https://avatars.githubusercontent.com/u/13337345?v=3","gravatar_id":"","url":"https://api.github.com/users/MHBauer","html_url":"https://github.com/MHBauer","followers_url":"https://api.github.com/users/MHBauer/followers","following_url":"https://api.github.com/users/MHBauer/following{/other_user}","gists_url":"https://api.github.com/users/MHBauer/gists{/gist_id}","starred_url":"https://api.github.com/users/MHBauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MHBauer/subscriptions","organizations_url":"https://api.github.com/users/MHBauer/orgs","repos_url":"https://api.github.com/users/MHBauer/repos","events_url":"https://api.github.com/users/MHBauer/events{/privacy}","received_events_url":"https://api.github.com/users/MHBauer/received_events","type":"User","site_admin":false},"repo":{"id":70524191,"name":"service-catalog","full_name":"MHBauer/service-catalog","owner":{"login":"MHBauer","id":13337345,"avatar_url":"https://avatars.githubusercontent.com/u/13337345?v=3","gravatar_id":"","url":"https://api.github.com/users/MHBauer","html_url":"https://github.com/MHBauer","followers_url":"https://api.github.com/users/MHBauer/followers","following_url":"https://api.github.com/users/MHBauer/following{/other_user}","gists_url":"https://api.github.com/users/MHBauer/gists{/gist_id}","starred_url":"https://api.github.com/users/MHBauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MHBauer/subscriptions","organizations_url":"https://api.github.com/users/MHBauer/orgs","repos_url":"https://api.github.com/users/MHBauer/repos","events_url":"https://api.github.com/users/MHBauer/events{/privacy}","received_events_url":"https://api.github.com/users/MHBauer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MHBauer/service-catalog","description":"Share and consume services in Kubernetes using service brokers","fork":true,"url":"https://api.github.com/repos/MHBauer/service-catalog","forks_url":"https://api.github.com/repos/MHBauer/service-catalog/forks","keys_url":"https://api.github.com/repos/MHBauer/service-catalog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MHBauer/service-catalog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MHBauer/service-catalog/teams","hooks_url":"https://api.github.com/repos/MHBauer/service-catalog/hooks","issue_events_url":"https://api.github.com/repos/MHBauer/service-catalog/issues/events{/number}","events_url":"https://api.github.com/repos/MHBauer/service-catalog/events","assignees_url":"https://api.github.com/repos/MHBauer/service-catalog/assignees{/user}","branches_url":"https://api.github.com/repos/MHBauer/service-catalog/branches{/branch}","tags_url":"https://api.github.com/repos/MHBauer/service-catalog/tags","blobs_url":"https://api.github.com/repos/MHBauer/service-catalog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MHBauer/service-catalog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MHBauer/service-catalog/git/refs{/sha}","trees_url":"https://api.github.com/repos/MHBauer/service-catalog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MHBauer/service-catalog/statuses/{sha}","languages_url":"https://api.github.com/repos/MHBauer/service-catalog/languages","stargazers_url":"https://api.github.com/repos/MHBauer/service-catalog/stargazers","contributors_url":"https://api.github.com/repos/MHBauer/service-catalog/contributors","subscribers_url":"https://api.github.com/repos/MHBauer/service-catalog/subscribers","subscription_url":"https://api.github.com/repos/MHBauer/service-catalog/subscription","commits_url":"https://api.github.com/repos/MHBauer/service-catalog/commits{/sha}","git_commits_url":"https://api.github.com/repos/MHBauer/service-catalog/git/commits{/sha}","comments_url":"https://api.github.com/repos/MHBauer/service-catalog/comments{/number}","issue_comment_url":"https://api.github.com/repos/MHBauer/service-catalog/issues/comments{/number}","contents_url":"https://api.github.com/repos/MHBauer/service-catalog/contents/{+path}","compare_url":"https://api.github.com/repos/MHBauer/service-catalog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MHBauer/service-catalog/merges","archive_url":"https://api.github.com/repos/MHBauer/service-catalog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MHBauer/service-catalog/downloads","issues_url":"https://api.github.com/repos/MHBauer/service-catalog/issues{/number}","pulls_url":"https://api.github.com/repos/MHBauer/service-catalog/pulls{/number}","milestones_url":"https://api.github.com/repos/MHBauer/service-catalog/milestones{/number}","notifications_url":"https://api.github.com/repos/MHBauer/service-catalog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MHBauer/service-catalog/labels{/name}","releases_url":"https://api.github.com/repos/MHBauer/service-catalog/releases{/id}","deployments_url":"https://api.github.com/repos/MHBauer/service-catalog/deployments","created_at":"2016-10-10T20:05:09Z","updated_at":"2016-12-19T22:54:54Z","pushed_at":"2017-01-17T08:36:46Z","git_url":"git://github.com/MHBauer/service-catalog.git","ssh_url":"git@github.com:MHBauer/service-catalog.git","clone_url":"https://github.com/MHBauer/service-catalog.git","svn_url":"https://github.com/MHBauer/service-catalog","homepage":"","size":67038,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"824d3eb9a78fa5a12a5456cf91baae2caa46578d","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":"2017-01-12T13:00:42Z","pushed_at":"2017-01-17T08:36:48Z","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":39669,"stargazers_count":46,"watchers_count":46,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":55,"forks":25,"open_issues":55,"watchers":46,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/235"},"html":{"href":"https://github.com/kubernetes-incubator/service-catalog/pull/235"},"issue":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/235"},"comments":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/235/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/235/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/235/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/statuses/de0b3fa6c9bccebf6f1db07f8b45f00f46333962"}}}}
{"actor":{"display_login":"duglin"}}