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

Bug 1791399

Summary: spec.customresourcedefinitions.owned.specDescriptors.value cannot be set
Product: OpenShift Container Platform Reporter: Matt Dorn <mdorn>
Component: OLMAssignee: Evan Cordell <ecordell>
OLM sub component: OLM QA Contact: Jian Zhang <jiazha>
Status: CLOSED NOTABUG Docs Contact:
Severity: unspecified    
Priority: unspecified CC: bandrade, bsong, scuppett
Version: 4.4   
Target Milestone: ---   
Target Release: 4.4.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: 2020-01-21 22:38:17 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:
Bug Depends On:    
Bug Blocks: 1790612    

Description Matt Dorn 2020-01-15 18:14:08 UTC
Description of problem:

If CSV sets spec.customresourcedefinitions.owned.specDescriptors.value to any string, InstallPlan fails.


Version-Release number of selected component (if applicable):

release-4.4
OLM version: 0.13.0
git commit: 2187d3e8c5a1bf949bd9d9e0a819ed8f9ecd8860


Steps to Reproduce:

1. CSV has spec.customresourcedefinitions.owned.specDescriptors.value = a string.

See https://github.com/operator-framework/community-operators/blob/master/upstream-community-operators/couchbase-enterprise/1.2.1/couchbase-v1.2.1.clusterserviceversion.yaml#L111

2. Create subscription using this CSV.

Actual results:

E0114 16:52:03.701658       1 queueinformer_operator.go:282] sync "openshift-operators" failed: Operation cannot be fulfilled on subscriptions.operators.coreos.com "couchbase-enterprise-certified": the object has been modified; please apply your changes to the latest version and try again
E0114 16:52:04.907712       1 queueinformer_operator.go:282] sync {"update" "openshift-operators/install-9ggj5"} failed: error creating csv couchbase-operator.v1.2.1: ClusterServiceVersion.operators.coreos.com "couchbase-operator.v1.2.1" is invalid: spec.customresourcedefinitions.owned.specDescriptors.value: Invalid value: "": spec.customresourcedefinitions.owned.specDescriptors.value in body must be of type byte: ""

Expected results:

InstallPlan Succeeds.

Additional info:

* Issue only occurs on release-4.4 with spec.customresourcedefinitions.owned.specDescriptors.value.

* Issue does not occur on release-4.2 or release-4.3.

* Issue does not occur on spec.customresourcedefinitions.owned.statusDescriptors.value.

Comment 1 Bowen Song 2020-01-21 22:38:17 UTC
This is not a bug, but rather because of the enforcement of the structural Schemas. We need to make sure the **type** of values matches expectations. https://kubernetes.io/blog/2019/06/20/crd-structural-schema/
The Old Operators's CSV needs to be updated to be deployed on the 4.4 clusters.

The type of the specDescriptor value is []byte/ json.rawmessage. See below: 

https://github.com/operator-framework/operator-lifecycle-manager/blob/372a68604a028eb9c0d61ce7beda0bf948ba11a6/pkg/api/apis/operators/v1alpha1/clusterserviceversion_types.go#L94