{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/comments/174564403","pull_request_review_id":103944492,"id":174564403,"diff_hunk":"@@ -92,6 +92,61 @@ type ClusterServiceBrokerSpec struct {\n \t// can be manually incremented by a user to manually trigger a relist.\n \t// +optional\n \tRelistRequests int64 `json:\"relistRequests\"`\n+\n+\t// CatalogRestrictions allows adding restrictions onto Class/Plans on relist.\n+\t// +optional\n+\tCatalogRestrictions *ServiceClassCatalogRestrictions `json:\"catalogRestrictions,omitempty\"`\n+}\n+\n+// *Requirements type strings have a special format similar to Label Selectors,\n+// except the catalog supports only a very specific property set per type as\n+// documented below.\n+// The predicate format is expected to be `<property><conditional><requirement>`\n+// Check the *Requirements type definition for which <property> strings will be allowed.\n+// <conditional> is allowed to be one of the following: ==, !=, in, notin\n+// <requirement> will be a string value if `==` or `!=` are used.\n+// <requirement> will be a set of string values if `in` or `notin` are used.\n+// Multiple predicates are allowed to be chained with a comma (,)\n+\n+// ClusterServiceClassRequirements represents a selector for classes used to filter.\n+// Allowed property names:\n+// name - the value set to ClusterServiceClass.Name\n+// externalName - the value set to ClusterServiceClass.Spec.ExternalName\n+type ClusterServiceClassRequirements string\n+\n+// ClusterServicePlanRequirements represents a selector for plans used to filter.\n+// Allowed property names:\n+// name - the value set to ClusterServiceClass.Name\n+// externalName - the value set to ClusterServiceClass.Spec.ExternalName\n+type ClusterServicePlanRequirements string\n+\n+// ServiceClassCatalogRestrictions contains the restrictions used to on catalog re-list.\n+// Some examples of this object are as follows:\n+//\n+// This is an example of a whitelist on service externalName.\n+// Goal: Only list Services with the externalName of FooService and BarService,\n+// Solution: restrictions := ServiceClassCatalogRestrictions{\n+// \t\tServiceClass: \"externalName in (FooService, BarService)\",\n+// }\n+//\n+// This is an example of a blacklist on service externalName.\n+// Goal: Allow all services except the ones with the externalName of FooService and BarService,\n+// Solution: restrictions := ServiceClassCatalogRestrictions{\n+// \t\tServiceClass: \"externalName notin (FooService, BarService)\",\n+// }\n+//\n+// This whitelists plans called \"Demo\", and blacklists (but only a single element in\n+// the list) a service and a plan.\n+// Goal: Allow all plans with the externalName demo, but not AABBCC, and not a specific service by name,\n+// Solution: restrictions := ServiceClassCatalogRestrictions{\n+// \t\tServiceClass: \"name!=AABBB-CCDD-EEGG-HIJK\",\n+// \t\tServicePlan: \"externalName in (Demo),name!=AABBCC\",\n+// }\n+type ServiceClassCatalogRestrictions struct {\n+\t// ServiceClass represents a selector for plans, used to filter catalog re-lists.\n+\tServiceClass ClusterServiceClassRequirements `json:\"serviceClass,omitempty\"`","path":"pkg/apis/servicecatalog/v1beta1/types.go","position":64,"original_position":56,"commit_id":"4bc662abf7401e5b77f86c943252329c31ad0727","original_commit_id":"815dba43d618f60b100d582402edc43a4675f807","user":{"login":"pmorie","id":366488,"avatar_url":"https://avatars2.githubusercontent.com/u/366488?v=4","gravatar_id":"","url":"https://api.github.com/users/pmorie","html_url":"https://github.com/pmorie","followers_url":"https://api.github.com/users/pmorie/followers","following_url":"https://api.github.com/users/pmorie/following{/other_user}","gists_url":"https://api.github.com/users/pmorie/gists{/gist_id}","starred_url":"https://api.github.com/users/pmorie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmorie/subscriptions","organizations_url":"https://api.github.com/users/pmorie/orgs","repos_url":"https://api.github.com/users/pmorie/repos","events_url":"https://api.github.com/users/pmorie/events{/privacy}","received_events_url":"https://api.github.com/users/pmorie/received_events","type":"User","site_admin":false},"body":"Array of strings is fine for me.","created_at":"2018-03-14T18:27:29Z","updated_at":"2018-03-14T18:27:29Z","html_url":"https://github.com/kubernetes-incubator/service-catalog/pull/1773#discussion_r174564403","pull_request_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/1773","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/comments/174564403"},"html":{"href":"https://github.com/kubernetes-incubator/service-catalog/pull/1773#discussion_r174564403"},"pull_request":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/1773"}},"in_reply_to_id":173859990},"pull_request":{"url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/1773","id":172051055,"html_url":"https://github.com/kubernetes-incubator/service-catalog/pull/1773","diff_url":"https://github.com/kubernetes-incubator/service-catalog/pull/1773.diff","patch_url":"https://github.com/kubernetes-incubator/service-catalog/pull/1773.patch","issue_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/1773","number":1773,"state":"open","locked":false,"title":"WIP: Working on adding whitelist/blacklist feature to Broker Relist.","user":{"login":"n3wscott","id":32305648,"avatar_url":"https://avatars3.githubusercontent.com/u/32305648?v=4","gravatar_id":"","url":"https://api.github.com/users/n3wscott","html_url":"https://github.com/n3wscott","followers_url":"https://api.github.com/users/n3wscott/followers","following_url":"https://api.github.com/users/n3wscott/following{/other_user}","gists_url":"https://api.github.com/users/n3wscott/gists{/gist_id}","starred_url":"https://api.github.com/users/n3wscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n3wscott/subscriptions","organizations_url":"https://api.github.com/users/n3wscott/orgs","repos_url":"https://api.github.com/users/n3wscott/repos","events_url":"https://api.github.com/users/n3wscott/events{/privacy}","received_events_url":"https://api.github.com/users/n3wscott/received_events","type":"User","site_admin":false},"body":"Seeing if we can use labels.Selector to filter the catalog.\r\n\r\nThings to do:\r\n[x] Services that are filtered out need to remove their plans.\r\n[x] Services that have all their plans filtered out should be removed.\r\n[x] Testing needs a fuller catalog to test real filtering.\r\n[x] Add filtering behind a feature flag.\r\n[] API validation should validate the filter string.\r\n[] Confirm the storage format is ok for the filter.\r\n  [] ---> Internal representation might need to be the processed labels.Selector.Requirements object?\r\n\r\nfixes https://github.com/kubernetes-incubator/service-catalog/issues/1604","created_at":"2018-02-28T19:36:20Z","updated_at":"2018-03-14T18:27:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c070c79996231b11079f3fa6d327a4ba70065ae5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":485046198,"url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/labels/cncf-cla:%20yes","name":"cncf-cla: yes","color":"ededed","default":false},{"id":676162243,"url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/labels/size/XXL","name":"size/XXL","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/1773/commits","review_comments_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/1773/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/1773/comments","statuses_url":"https://api.github.com/repos/kubernetes-incubator/service-catalog/statuses/4bc662abf7401e5b77f86c943252329c31ad0727","head":{"label":"n3wscott:whitelist_from_labels","ref":"whitelist_from_labels","sha":"4bc662abf7401e5b77f86c943252329c31ad0727","user":{"login":"n3wscott","id":32305648,"avatar_url":"https://avatars3.githubusercontent.com/u/32305648?v=4","gravatar_id":"","url":"https://api.github.com/users/n3wscott","html_url":"https://github.com/n3wscott","followers_url":"https://api.github.com/users/n3wscott/followers","following_url":"https://api.github.com/users/n3wscott/following{/other_user}","gists_url":"https://api.github.com/users/n3wscott/gists{/gist_id}","starred_url":"https://api.github.com/users/n3wscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n3wscott/subscriptions","organizations_url":"https://api.github.com/users/n3wscott/orgs","repos_url":"https://api.github.com/users/n3wscott/repos","events_url":"https://api.github.com/users/n3wscott/events{/privacy}","received_events_url":"https://api.github.com/users/n3wscott/received_events","type":"User","site_admin":false},"repo":{"id":105072788,"name":"service-catalog","full_name":"n3wscott/service-catalog","owner":{"login":"n3wscott","id":32305648,"avatar_url":"https://avatars3.githubusercontent.com/u/32305648?v=4","gravatar_id":"","url":"https://api.github.com/users/n3wscott","html_url":"https://github.com/n3wscott","followers_url":"https://api.github.com/users/n3wscott/followers","following_url":"https://api.github.com/users/n3wscott/following{/other_user}","gists_url":"https://api.github.com/users/n3wscott/gists{/gist_id}","starred_url":"https://api.github.com/users/n3wscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n3wscott/subscriptions","organizations_url":"https://api.github.com/users/n3wscott/orgs","repos_url":"https://api.github.com/users/n3wscott/repos","events_url":"https://api.github.com/users/n3wscott/events{/privacy}","received_events_url":"https://api.github.com/users/n3wscott/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/n3wscott/service-catalog","description":"Consume services in Kubernetes using the Open Service Broker API","fork":true,"url":"https://api.github.com/repos/n3wscott/service-catalog","forks_url":"https://api.github.com/repos/n3wscott/service-catalog/forks","keys_url":"https://api.github.com/repos/n3wscott/service-catalog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/n3wscott/service-catalog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/n3wscott/service-catalog/teams","hooks_url":"https://api.github.com/repos/n3wscott/service-catalog/hooks","issue_events_url":"https://api.github.com/repos/n3wscott/service-catalog/issues/events{/number}","events_url":"https://api.github.com/repos/n3wscott/service-catalog/events","assignees_url":"https://api.github.com/repos/n3wscott/service-catalog/assignees{/user}","branches_url":"https://api.github.com/repos/n3wscott/service-catalog/branches{/branch}","tags_url":"https://api.github.com/repos/n3wscott/service-catalog/tags","blobs_url":"https://api.github.com/repos/n3wscott/service-catalog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/n3wscott/service-catalog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/n3wscott/service-catalog/git/refs{/sha}","trees_url":"https://api.github.com/repos/n3wscott/service-catalog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/n3wscott/service-catalog/statuses/{sha}","languages_url":"https://api.github.com/repos/n3wscott/service-catalog/languages","stargazers_url":"https://api.github.com/repos/n3wscott/service-catalog/stargazers","contributors_url":"https://api.github.com/repos/n3wscott/service-catalog/contributors","subscribers_url":"https://api.github.com/repos/n3wscott/service-catalog/subscribers","subscription_url":"https://api.github.com/repos/n3wscott/service-catalog/subscription","commits_url":"https://api.github.com/repos/n3wscott/service-catalog/commits{/sha}","git_commits_url":"https://api.github.com/repos/n3wscott/service-catalog/git/commits{/sha}","comments_url":"https://api.github.com/repos/n3wscott/service-catalog/comments{/number}","issue_comment_url":"https://api.github.com/repos/n3wscott/service-catalog/issues/comments{/number}","contents_url":"https://api.github.com/repos/n3wscott/service-catalog/contents/{+path}","compare_url":"https://api.github.com/repos/n3wscott/service-catalog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/n3wscott/service-catalog/merges","archive_url":"https://api.github.com/repos/n3wscott/service-catalog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/n3wscott/service-catalog/downloads","issues_url":"https://api.github.com/repos/n3wscott/service-catalog/issues{/number}","pulls_url":"https://api.github.com/repos/n3wscott/service-catalog/pulls{/number}","milestones_url":"https://api.github.com/repos/n3wscott/service-catalog/milestones{/number}","notifications_url":"https://api.github.com/repos/n3wscott/service-catalog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/n3wscott/service-catalog/labels{/name}","releases_url":"https://api.github.com/repos/n3wscott/service-catalog/releases{/id}","deployments_url":"https://api.github.com/repos/n3wscott/service-catalog/deployments","created_at":"2017-09-27T21:46:31Z","updated_at":"2017-09-27T21:46:34Z","pushed_at":"2018-03-12T22:56:16Z","git_url":"git://github.com/n3wscott/service-catalog.git","ssh_url":"git@github.com:n3wscott/service-catalog.git","clone_url":"https://github.com/n3wscott/service-catalog.git","svn_url":"https://github.com/n3wscott/service-catalog","homepage":"","size":97602,"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,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes-incubator:master","ref":"master","sha":"0a9f1e45778de830269297c4aa44e6b1e25a66ac","user":{"login":"kubernetes-incubator","id":20862812,"avatar_url":"https://avatars2.githubusercontent.com/u/20862812?v=4","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://avatars2.githubusercontent.com/u/20862812?v=4","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":"Consume services in Kubernetes using the Open Service Broker API","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":"2018-03-14T05:56:56Z","pushed_at":"2018-03-14T14:05:14Z","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":97639,"stargazers_count":420,"watchers_count":420,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":157,"mirror_url":null,"archived":false,"open_issues_count":216,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":157,"open_issues":216,"watchers":420,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/1773"},"html":{"href":"https://github.com/kubernetes-incubator/service-catalog/pull/1773"},"issue":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/1773"},"comments":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/issues/1773/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/pulls/1773/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/1773/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes-incubator/service-catalog/statuses/4bc662abf7401e5b77f86c943252329c31ad0727"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pmorie"}}