Bug 1791399 - spec.customresourcedefinitions.owned.specDescriptors.value cannot be set
Summary: spec.customresourcedefinitions.owned.specDescriptors.value cannot be set
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 4.4.0
Assignee: Evan Cordell
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On:
Blocks: 1790612
TreeView+ depends on / blocked
 
Reported: 2020-01-15 18:14 UTC by Matt Dorn
Modified: 2020-01-21 22:38 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-21 22:38:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.