-
Notifications
You must be signed in to change notification settings - Fork 373
Add List/Relist Catalog Restrictions #1773
Changes from 10 commits
c0de801
4060ca1
3eac4e2
c1fd237
9dd7bc2
7ecd694
72f7539
8cb4639
815dba4
4bc662a
e6c99d8
bd96336
25cf545
6cdeb3b
48f4444
84f52a9
94c89b0
4b7bc89
2e08402
f959fd2
1590bd8
ad38b27
ebff045
2fe49b8
5785b69
0ce636c
f0a23ad
0eb1529
9dcfa79
76b5450
9039cf0
5de5989
d33b2a0
4285b72
7144232
b6507f8
71a7d85
d6f8448
88022e6
114dcb1
1b105b4
ce24688
5e9e946
b7276aa
60650e8
e3aed41
63f5691
14c39d1
6cbedc4
0b99c5d
a75f8ee
362278f
dfdabaa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,6 +92,69 @@ type ClusterServiceBrokerSpec struct { | |
| // can be manually incremented by a user to manually trigger a relist. | ||
| // +optional | ||
| RelistRequests int64 `json:"relistRequests"` | ||
|
|
||
| // CatalogRestrictions allows adding restrictions onto Class/Plans on relist. | ||
|
||
| // +optional | ||
| CatalogRestrictions *ServiceClassCatalogRestrictions `json:"catalogRestrictions,omitempty"` | ||
|
||
| } | ||
|
|
||
| // *Requirements type strings have a special format similar to Label Selectors, | ||
| // except the catalog supports only a very specific property set per type as | ||
| // documented below. | ||
| // The predicate format is expected to be `<property><conditional><requirement>` | ||
| // Check the *Requirements type definition for which <property> strings will be allowed. | ||
| // <conditional> is allowed to be one of the following: ==, !=, in, notin | ||
| // <requirement> will be a string value if `==` or `!=` are used. | ||
| // <requirement> will be a set of string values if `in` or `notin` are used. | ||
| // Multiple predicates are allowed to be chained with a comma (,) | ||
|
|
||
| // ClusterServiceClassRequirements represents a list of selectors for classes used to filter. | ||
| // Requirements are AND'ed together from the list. | ||
| type ClusterServiceClassRequirements []ClusterServiceClassRequirement | ||
|
|
||
| // ClusterServiceClassRequirement represents a selector for classes used to filter. | ||
| // Allowed property names: | ||
| // name - the value set to ClusterServiceClass.Name | ||
| // externalName - the value set to ClusterServiceClass.Spec.ExternalName | ||
| type ClusterServiceClassRequirement string | ||
|
|
||
| // ClusterServicePlanRequirements represents a list of selectors for plans used to filter. | ||
| // Requirements are AND'ed together from the list. | ||
| type ClusterServicePlanRequirements []ClusterServicePlanRequirement | ||
|
|
||
| // ClusterServicePlanRequirement represents a selector for plans used to filter. | ||
| // Allowed property names: | ||
| // name - the value set to ClusterServiceClass.Name | ||
| // externalName - the value set to ClusterServiceClass.Spec.ExternalName | ||
| type ClusterServicePlanRequirement string | ||
|
|
||
| // ServiceClassCatalogRestrictions contains the restrictions used to on catalog re-list. | ||
| // Some examples of this object are as follows: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It needs to be more clear that the restriction expressions are in terms of the k8s API resources. It would also be more correct to say
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, good call. I think we should make that clear. I had this with field selectors and it got lost when I was attempting label selectors. I can add it back. Then
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
| // | ||
| // This is an example of a whitelist on service externalName. | ||
| // Goal: Only list Services with the externalName of FooService and BarService, | ||
| // Solution: restrictions := ServiceClassCatalogRestrictions{ | ||
| // ServiceClass: "externalName in (FooService, BarService)", | ||
| // } | ||
| // | ||
| // This is an example of a blacklist on service externalName. | ||
| // Goal: Allow all services except the ones with the externalName of FooService and BarService, | ||
| // Solution: restrictions := ServiceClassCatalogRestrictions{ | ||
| // ServiceClass: "externalName notin (FooService, BarService)", | ||
| // } | ||
| // | ||
| // This whitelists plans called "Demo", and blacklists (but only a single element in | ||
| // the list) a service and a plan. | ||
| // Goal: Allow all plans with the externalName demo, but not AABBCC, and not a specific service by name, | ||
| // Solution: restrictions := ServiceClassCatalogRestrictions{ | ||
| // ServiceClass: "name!=AABBB-CCDD-EEGG-HIJK", | ||
| // ServicePlan: "externalName in (Demo),name!=AABBCC", | ||
| // } | ||
| type ServiceClassCatalogRestrictions struct { | ||
| // ServiceClass represents a selector for plans, used to filter catalog re-lists. | ||
| ServiceClass ClusterServiceClassRequirements `json:"serviceClass,omitempty"` | ||
|
||
| // ServicePlan represents a selector for classes, used to filter catalog re-lists. | ||
| ServicePlan ClusterServicePlanRequirements `json:"servicePlan,omitempty"` | ||
| } | ||
|
|
||
| // ServiceBrokerRelistBehavior represents a type of broker relist behavior. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me how I would say:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added some more comments to help you understand.