Bug 1731886 - It always prompts error when create CouchBase cluster from "Edit Form" model
Summary: It always prompts error when create CouchBase cluster from "Edit Form" model
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.2.0
Assignee: Alec Merdler
QA Contact: Yadan Pei
URL:
Whiteboard:
: 1732611 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-22 09:41 UTC by Yanping Zhang
Modified: 2019-11-06 10:08 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-16 06:30:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 2507 0 'None' closed Bug 1731886: Allow Non-Required Operand Fields to be Empty 2020-02-03 06:34:08 UTC
Red Hat Product Errata RHBA-2019:2922 0 None None None 2019-10-16 06:30:35 UTC

Description Yanping Zhang 2019-07-22 09:41:33 UTC
Description of problem:
Installed CouchBase operator in cluster, when try to create CouchBase cluster from installed operator page, if use "Edit Form", after click "Create", it always prompts error info.

Version-Release number of selected component (if applicable):
4.2.0-0.nightly-2019-07-21-222447
console image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:f1f6849d559c569cea95799ffa85483a48e01b0628e09ece82420e31b4c88e34

How reproducible:
Always

Steps to Reproduce:
1.Install CouchBase operator in cluster. 
2.On "Installed Operators" page, click into "Couchbase Operator".
3.Create Couchbase cluster by clicking "Create Instance".
4.Choose "Edit Form", input all fields, then click "Create".

Actual results:
4.It always prompts error info, seems the form didn't include all required fields. Error info:

Error "Invalid value: map[string]interface {}{"apiVersion":"couchbase.com/v1", "kind":"CouchbaseCluster", "metadata":map[string]interface {}{"creationTimestamp":"2019-07-22T09:29:36Z", "generation":1, "labels":map[string]interface {}{"app":"test"}, "name":"exampletest", "namespace":"prozyp", "uid":"38e1d57e-ac63-11e9-b71a-06cd61a4e67c"}, "spec":map[string]interface {}{"antiAffinity":true, "authSecret":"etcd-operator-token-stmpx", "cluster":map[string]interface {}{"autoFailoverMaxCount":3}, "disableBucketManagement":true, "exposeAdminConsole":true, "paused":false, "servers":[]interface {}{map[string]interface {}{"pod":map[string]interface {}{"resources":map[string]interface {}{"limits":map[string]interface {}{"cpu":"100m", "memory":"50Mi"}, "requests":map[string]interface {}{"cpu":"100m", "memory":"50Mi"}}}}}, "softwareUpdateNotifications":true, "tls":map[string]interface {}{"static":map[string]interface {}{"member":map[string]interface {}{"serverSecret":"default-dockercfg-wcpj5"}, "operatorSecret":"builder-token-wljjc"}}}}: validation failure list: spec.cluster.dataServiceMemoryQuota in body is required spec.cluster.indexServiceMemoryQuota in body is required spec.cluster.searchServiceMemoryQuota in body is required spec.cluster.eventingServiceMemoryQuota in body is required spec.cluster.analyticsServiceMemoryQuota in body is required spec.cluster.indexStorageSetting in body is required spec.cluster.autoFailoverTimeout in body is required spec.servers.size in body is required spec.servers.name in body is required spec.servers.services in body is required spec.baseImage in body is required spec.version in body is required" for field "[]".

Expected results:
4. Should create successfully.

Additional info:

Comment 1 Alec Merdler 2019-07-23 17:44:28 UTC
This happens because there are required fields on the `CouchbaseCluster` CRD that do not have associated OLM descriptors or implemented form input components [1]. This will be a problem for all Operators in a similar situation. 

[1] https://github.com/openshift/console/tree/master/frontend/public/components/operator-lifecycle-manager/descriptors

Comment 2 Yanping Zhang 2019-07-25 10:02:42 UTC
@Alec, how to deal with this problem you said in Comment 1 ? Users may not know what's wrong with the CRD.
Does it mean that need to update all operators to adopt the new Descriptor approach?

Comment 3 Alec Merdler 2019-07-25 15:10:18 UTC
I've actually discovered a way to fix this issue without having to implement descriptors for all required CRD fields: As long as the CSV contains a valid sample object (in `alm-examples` annotation), then we can use this to fill in the missing required fields that don't have descriptor input components. I'll update this ticket once the pull request is open.

Comment 4 Samuel Padgett 2019-07-26 16:58:06 UTC
*** Bug 1732611 has been marked as a duplicate of this bug. ***

Comment 5 Yanping Zhang 2019-08-21 07:08:12 UTC
@Alec, checked on recently 4.2 env with payload 4.2.0-0.nightly-2019-08-20-213632, seems there are some fixes about the bug, now on the "Edit form" page, there is prompt info:
"Note: Some fields may not be represented in this form. Please select "Edit YAML" for full control of object creation."
And after click "Create", there is no error info pasted in the bug description.
Are these all for the bug fix?

Comment 7 Yanping Zhang 2019-08-30 02:49:52 UTC
4.2.0-0.nightly-2019-08-29-170426
Tested on ocp 4.2 env with above version, now user could create cluster instance from "Edit Form" without error. The bug has been fixed, so move it to Verified.

Comment 8 errata-xmlrpc 2019-10-16 06:30:16 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-2019:2922


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