Bug 1821432

Summary: Toggle controls in OLM CR details page do not update the CR correctly
Product: OpenShift Container Platform Reporter: Rob Cernich <rcernich>
Component: Management ConsoleAssignee: Cyril <cajieh>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.3.zCC: aos-bugs, jokerman, rhamilto, spadgett, ssadhale, yanpzhan, yuaxu
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: coding error and missing requirement Consequence: Fix: Fixed Result: Working as expected.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-13 17:25:52 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 Rob Cernich 2020-04-06 19:50:08 UTC
Description of problem:

When toggling a control bound to a boolean field in a CR, the wrong field in the CR is updated.

For example, the control is bound to "istio.global.mtls.enabled" and the control is setting:

istio:
  global.mtls.enabled: true

It should be setting:

istio:
  global:
    mtls:
      enabled: true


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

4.3.9


How reproducible:

Always


Steps to Reproduce:
1.
2.
3.

Actual results:

istio:
  global.mtls.enabled: true

Expected results:

istio:
  global:
    mtls:
      enabled: true

Additional info:

Comment 1 Yuanlin Xu 2020-04-06 19:54:19 UTC
We see same issue in OCP 4.4.0-rc.6 as well.

Comment 2 Cyril 2020-04-07 17:21:56 UTC
Steps to Reproduce is missing, please provide.

Comment 3 Rob Cernich 2020-04-07 17:56:10 UTC
Any CSV that includes a custom resource with UI annotations that map to a nested field, more than two levels deep.  You can use the OpenShift Service Mesh operator, then create a Service Mesh Control Plane.  After it's created try toggling one of the fields, e.g. Install Kiali.  Notice it spins forever after pressing confirm.  Switch to yaml view and notice it created a spec: { istio: { kiali.enabled: true } } instead of spec: { istio: { kiali: { enabled: true } } }.

I'd suggest writing a unit test to reproduce the behavior.

Comment 4 Yuanlin Xu 2020-04-07 18:08:06 UTC
Here is an example of "Steps to Reproduce:"
1. Create a OCP4.3 or 4.4.0 cluster
2. Install an operator which include a custom resource with UI annotations that map to a nested field, more than two levels deep. 

As an example, we can use the OpenShift Service Mesh operator.
3. Create a Service Mesh Control Plane from the "Installed operators" --> OpenShift Service Mesh operator
4. Navigate UI page "Installed operators" --> OpenShift Service Mesh operator --> All instances --> basic-install -->  Service Mesh Control Plane Overview
5. Toggling any of the Toggle control. Click "change confirmed" right next to the Toggle control

Problem results:
1. It spins forever after pressing confirm
2. Switch to yaml view and notice it created a spec: { istio: { kiali.enabled: true } } instead of spec: { istio: { kiali: { enabled: true } } }.

Expected behaviour:
1. The Toggle control should not spins forever after perssing confirm
2. The yaml changes should be updated in a correct way in the description above.

Comment 7 Yanping Zhang 2020-05-09 03:03:42 UTC
Checked on ocp 4.5 cluster with payload 4.5.0-0.nightly-2020-05-08-200452.
Install OpenShift Service Mesh operator, then create an ServiceMeshControlPlanes instance, check the instance yaml, it shows istio->kiali in spec correctly:
  istio
    kiali:
      enabled: true
On the instance detail page, change panel control for kiali to false, click "Confirm change", it takes effect after a while, and the yaml shows istio->kiali in spec correctly:
  istio:
    kiali:
      enabled: false

Comment 9 errata-xmlrpc 2020-07-13 17:25:52 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-2020:2409