Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Introduce spec.free to catalog restrictions for Plans #2211

Conversation

jeremyrickard
Copy link
Contributor

This PR extends the existing catalog restrictions to allow the user to specify spec.free when providing [Cluster]ServicePlan catalog restrictions. This also adds relevant documentation for catalog restrictions.

Closes: #2209, #2156

@k8s-ci-robot k8s-ci-robot requested review from carolynvs and vaikas July 18, 2018 18:08
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 18, 2018
@jeremyrickard jeremyrickard changed the title Introduce spec.free to catalog restrictions for Plans WIP: Introduce spec.free to catalog restrictions for Plans Jul 18, 2018
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 18, 2018
@jeremyrickard
Copy link
Contributor Author

jeremyrickard commented Jul 18, 2018

@jeremyrickard jeremyrickard changed the title WIP: Introduce spec.free to catalog restrictions for Plans Introduce spec.free to catalog restrictions for Plans Jul 18, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 18, 2018
Copy link
Contributor

@carolynvs carolynvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's like documentation Christmas today! 🎄

The rule format is expected to be `<property><conditional><requirement>`

* `<conditional>` is allowed to be one of the following: ==, !=, in, notin
* `<requirement>` will be a string value if `==` or `!=` are used.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: combine into a single bullet will be a string value if.... otherwise it will be a set of string values if ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add a bullet for the property and give them a hint or a few examples of what it should look like, i.e. it should have the leading spec. prefix

| Property Name | Description |
| name | the value set to ClusterServiceClass.Name |
| spec.externalName | the value set to ClusterServiceClass.Spec.ExternalName |
| spec.externalID | the value set to ClusterServiceClass.Spec.ExternalID |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the value set to " is a bit confusing. Can we use a plain english description or maybe something else? I'm not quite sure what to suggest, sorry!


This example creates a Service Class restriction on spec.externalName using the
`in` operator. In this case, only services that have the externalName
`FooService` or `BarService` will have Service Catalog resources created.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the filter case sensitive? i.e. would "fooservice, barservice" work too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a good question! let me read the code and figure that out. Will add relevant text to this to make sure!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! ❤️

toc:
- docs/catalog-restrictions.md
- title: Catalog Restrictions
path: /docs/catalog-restrictions/#catalog-restrictions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious if you have tried making these paths just path: #catalog-restrinctions and if that works or not? I'm starting to wonder if I imagined it. 😁

Copy link
Contributor

@jboyd01 jboyd01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loving the new documentation! Thanks for doing it.

In this example, a catalog restriction has been defined that specifies that
only service plans that have an external name of basic should be selected.
Catalog restrictions are defined as a set of one or more rules that target
either service classes and service plans. These rules have a special format
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catalog restrictions are defined as a set of one or more rules that target either service classes and service plans

Because of the word either, I think and should be an or. Perhaps we should say "that target service classes and/or service plans"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh yeah thanks! Forgot to remove that word. You can supply both. so and/or

| spec.externalID | This key will match the ServicePlan.Spec.ExternalID property |
| spec.free | This key will match the ServicePlan.Spec.Free property |
| spec.serviceClass.name | This key will match the ServicePlan.Spec.ServiceClassRef.Name property |

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the property key and descriptions are the same for the NS and Cluster scoped Plan/Class, I'd suggest combining them. IE "ClusterServicePlan and ServicePlan allowed property names"
Same with the Classes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are almost the same. There are some shared keys, but we also allow to supplies predicates that reference the non-common parts, i.e. ServicePlans can be filtered with ServiceClassRef.Name and ClusterServicePlans can be filtered with ClusterServiceClassRef.Name.

Would you favor doing a shared block and then call out the two differences?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeremyrickard I missed that. I totally agree, leave it as is, thank you.

@jeremyrickard jeremyrickard force-pushed the catalog-restrictions-free-plans branch from d95bfc9 to 79b7e9d Compare July 19, 2018 00:56
@jeremyrickard
Copy link
Contributor Author

@carolynvs @jboyd01 I've updated this PR to add this doc to the README.md under topics for operators and I modified the namespaced doc to link here, as was suggested in that PR. Take a 👀

@jboyd01
Copy link
Contributor

jboyd01 commented Jul 19, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 19, 2018
@jboyd01 jboyd01 added the LGTM1 label Jul 19, 2018
@carolynvs
Copy link
Contributor

/approve
/label LGTM2

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: carolynvs

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 19, 2018
@k8s-ci-robot k8s-ci-robot merged commit 7f85b12 into kubernetes-retired:master Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. LGTM1 LGTM2 size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend Catalog Restrictions to include spec.Free for [Cluster]ServicePlans
4 participants