Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1611310

Summary: [SC] the restriction for "spec.free" field doesn't work
Product: OpenShift Container Platform Reporter: Jian Zhang <jiazha>
Component: Service CatalogAssignee: Jay Boyd <jaboyd>
Status: CLOSED ERRATA QA Contact: Jian Zhang <jiazha>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.11.0CC: jaboyd, jiazha
Target Milestone: ---Keywords: Reopened
Target Release: 3.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-11 07:23:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jian Zhang 2018-08-02 08:34:52 UTC
Description of problem:
the restriction for  "spec.free" field doesn't work, but the restriction for "spec.externalName" works.

Version-Release number of selected component (if applicable):
service catalog: v3.11.0-0.10.0;Upstream:v0.1.25
ASB: 1.3.5

How reproducible:
always

Steps to Reproduce:
1. Add restrictions to the clusterservicebroker, such as ASB, as below:
# oc edit clusterservicebroker ansible-service-broker
...
  catalogRestrictions:
    servicePlan:
    - spec.free==true

2. Get the clusterserviceclass/clusterserviceplan resources.


Actual results:
[root@ip-172-18-15-43 ~]# oc get clusterserviceclass
No resources found.
[root@ip-172-18-15-43 ~]# oc get clusterserviceplan
No resources found.


Expected results:
The restriction for "spec.free" field should work. The restriction for "spec.free" field should work. Should list the free clusterserviceplan and related clusterserviceclass.

Additional info:

Comment 1 Jay Boyd 2018-08-02 14:56:24 UTC
I'm having issues getting ASB installed, but I did try this with the upstream UPS broker and verified this works and removed a single plan that was not free.

Can you post the Catalog Controller logs please?  After changing the spec we should see entries like this in the controller log:

I0802 14:47:47.965292       1 controller_clusterserviceplan.go:73] ClusterServicePlan "96064792-7ea2-467b-af93-ac9694d96d52" (ExternalName: "default"): processing
I0802 14:47:47.965293       1 controller_clusterserviceplan.go:73] ClusterServicePlan "86064792-7ea2-467b-af93-ac9694d96d52" (ExternalName: "default"): processing
I0802 14:47:47.965294       1 controller_clusterserviceplan.go:73] ClusterServicePlan "cc0d7529-18e8-416d-8946-6f7456acd589" (ExternalName: "premium"): processing
I0802 14:47:47.966424       1 event.go:221] Event(v1.ObjectReference{Kind:"ClusterServiceBroker", Namespace:"", Name:"ups-broker", UID:"05d061f8-9663-11e8-9c0f-0242ac11000c", APIVersion:"servicecatalog.k8s.io/v1beta1", ResourceVersion:"1
832", FieldPath:""}): type: 'Normal' reason: 'FetchedCatalog' Successfully fetched catalog entries from broker.
I0802 14:47:47.973543       1 controller_clusterserviceclass.go:72] ClusterServiceClass "4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468" (ExternalName: "user-provided-service"): processing
I0802 14:47:47.973561       1 controller_clusterserviceclass.go:72] ClusterServiceClass "5f6e6cf6-ffdd-425f-a2c7-3c9258ad2468" (ExternalName: "user-provided-service-single-plan"): processing
I0802 14:47:47.973591       1 controller_clusterserviceclass.go:72] ClusterServiceClass "8a6229d4-239e-4790-ba1f-8367004d0473" (ExternalName: "user-provided-service-with-schemas"): processing
.......
I0802 14:48:54.301804       1 controller_clusterserviceplan.go:79] ClusterServicePlan "cc0d7529-18e8-416d-8946-6f7456acd589" (ExternalName: "premium"): has been removed from broker catalog; determining whether there are instances remaining
I0802 14:48:54.309977       1 controller_clusterserviceplan.go:90] ClusterServicePlan "cc0d7529-18e8-416d-8946-6f7456acd589" (ExternalName: "premium"): has been removed from broker catalog and has zero instances remaining; deleting

Comment 2 Jian Zhang 2018-08-03 03:18:44 UTC
Jay,

I don't find the reported issue based on the latest version: v0.1.27. It works as expected, maybe something has been updated in it.

I0803 02:32:50.413707       1 controller_clusterserviceplan.go:73] ClusterServicePlan "ca765c1a72980c66c47fbd91e4520cb9" (ExternalName: "prod"): processing
I0803 02:32:50.413739       1 controller_clusterserviceplan.go:73] ClusterServicePlan "90a52436b53f13f9a73b053d91693ad5" (ExternalName: "default"): processing
I0803 02:32:50.413762       1 controller_clusterserviceplan.go:73] ClusterServicePlan "ee5755df92c889b57e44cfdc78d3ee6c" (ExternalName: "dev"): processing
I0803 02:32:50.413774       1 controller_clusterserviceplan.go:73] ClusterServicePlan "f60fb1df2bb974a3779cbd897a2fdc95" (ExternalName: "prod"): processing
I0803 02:32:50.413867       1 controller_clusterserviceplan.go:73] ClusterServicePlan "7987a66a6d5be0ad62e61699d455a315" (ExternalName: "dev"): processing
I0803 02:32:50.413886       1 controller_clusterserviceplan.go:73] ClusterServicePlan "73cbfe24e729d9564675987c631d32c1" (ExternalName: "prod"): processing
I0803 02:32:50.413904       1 controller_clusterserviceplan.go:73] ClusterServicePlan "86368bc0b8857c82240b722730646c68" (ExternalName: "dev"): processing
I0803 02:32:51.437548       1 controller_clusterserviceplan.go:73] ClusterServicePlan "73cbfe24e729d9564675987c631d32c1" (ExternalName: "prod"): processing
I0803 02:32:51.437573       1 controller_clusterserviceplan.go:79] ClusterServicePlan "73cbfe24e729d9564675987c631d32c1" (ExternalName: "prod"): has been removed from broker catalog; determining whether there are instances remaining
I0803 02:32:51.518713       1 event.go:221] Event(v1.ObjectReference{Kind:"ClusterServiceBroker", Namespace:"", Name:"ansible-service-broker", UID:"3faf397a-96c0-11e8-b12f-0a580a800004", APIVersion:"servicecatalog.k8s.io/v1beta1", ResourceVersion:"9708", FieldPath:""}): type: 'Normal' reason: 'FetchedCatalog' Successfully fetched catalog entries from broker.
I0803 02:32:51.703322       1 controller_clusterserviceplan.go:90] ClusterServicePlan "73cbfe24e729d9564675987c631d32c1" (ExternalName: "prod"): has been removed from broker catalog and has zero instances remaining; deleting

Comment 3 Jay Boyd 2018-08-03 13:13:30 UTC
It could be we picked up a fix since the issue was originally reported Jian.  Thanks for retesting.

Closing: can't reproduce/worksforme

Comment 6 Jian Zhang 2018-08-13 09:40:46 UTC
Jay,

Thanks! LGTM, verify it.
The sc version: v3.11.0-0.14.0;Upstream:v0.1.27

Comment 8 errata-xmlrpc 2018-10-11 07:23:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:2652