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

Bug 1797086

Summary: specDescriptor urn:alm:descriptor:com.tectonic.ui:booleanSwitch does not default to false [openshift-4.3]
Product: OpenShift Container Platform Reporter: Robb Hamilton <rhamilto>
Component: Management ConsoleAssignee: Robb Hamilton <rhamilto>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.3.0CC: aos-bugs, bpeterse, hasha, jokerman, mdorn, yapei
Target Milestone: ---   
Target Release: 4.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1796634 Environment:
Last Closed: 2020-02-25 06:18:00 UTC Type: ---
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: 1796634, 1797091    

Description Robb Hamilton 2020-01-31 21:06:55 UTC
+++ This bug was initially created as a clone of Bug #1796634 +++

Description of problem:
In OpenShift 4.2, use of urn:alm:descriptor:com.tectonic.ui:booleanSwitch does not default to false as detailed here:

https://github.com/openshift/console/blob/master/frontend/packages/operator-lifecycle-manager/src/components/descriptors/reference/reference.md#4-booleanswitch

It will default to true.

Using specDescriptors.value = [false] will also show true.

Using specDescriptors.value = "false" in 4.2 will show false, but this is a mis-use of this field as it should only accept type byte rawJson. This will be enforced in OCP 4.4

See https://bugzilla.redhat.com/show_bug.cgi?id=1794580 for more information.

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

How reproducible:

Install CSV with booleanSwitch, example:

      specDescriptors:
      - description: A description of this switch
        displayName: Paused
        path: paused
        x-descriptors:
        - urn:alm:descriptor:com.tectonic.ui:booleanSwitch

Expected result:

Should default to false as specified in docs

Additional Information:
This issue does not occur on 4.3 and 4.4.

Comment 1 Robb Hamilton 2020-01-31 21:09:42 UTC
This was fixed before 4.3.0 shipped with https://github.com/openshift/console/pull/3390

Comment 3 shahan 2020-02-07 08:11:57 UTC
Install couchbase operator, check the csv with following booleanswitch:  (all default value is false)

         - description: Specifies if the Operator will manage this cluster.
            displayName: Paused
            path: paused
            value: false
            x-descriptors:
              - 'urn:alm:descriptor:com.tectonic.ui:booleanSwitch'
          - description: >-
              Specifies if the Couchbase Server Web Console will be exposed
              externally.
            displayName: Expose Console
            path: exposeAdminConsole
            value: false
            x-descriptors:
              - 'urn:alm:descriptor:com.tectonic.ui:booleanSwitch'
          - description: >-
              Specifies whether or not two pods in this cluster can be deployed
              on the same Kubernetes node.
            displayName: Anti Affinity
            path: antiAffinity
            value: false
            x-descriptors:
              - 'urn:alm:descriptor:com.tectonic.ui:booleanSwitch'
          - description: >-
              Specifies if update notifications will be displayed in the
              Couchbase UI.
            displayName: Show Update Notifications
            path: softwareUpdateNotifications
            value: false
            x-descriptors:
              - 'urn:alm:descriptor:com.tectonic.ui:booleanSwitch'
          - description: Specifies if the Operator will create or delete buckets.
            displayName: Disable Bucket Management
            path: disableBucketManagement
            value: false
            x-descriptors:
              - 'urn:alm:descriptor:com.tectonic.ui:booleanSwitch'

but when create the Couchbase Cluster instance, and check the instance overview page:

we found the default value for  "Expose Console"  is true.

4.3.0-0.nightly-2020-02-07-003021

Comment 5 Robb Hamilton 2020-02-13 15:19:40 UTC
@sh(In reply to shahan from comment #3)
> Install couchbase operator, check the csv with following booleanswitch: 
> (all default value is false)
> 
>          - description: Specifies if the Operator will manage this cluster.
>             displayName: Paused
>             path: paused
>             value: false
>             x-descriptors:
>               - 'urn:alm:descriptor:com.tectonic.ui:booleanSwitch'
>           - description: >-
>               Specifies if the Couchbase Server Web Console will be exposed
>               externally.
>             displayName: Expose Console
>             path: exposeAdminConsole
>             value: false
>             x-descriptors:
>               - 'urn:alm:descriptor:com.tectonic.ui:booleanSwitch'
>           - description: >-
>               Specifies whether or not two pods in this cluster can be
> deployed
>               on the same Kubernetes node.
>             displayName: Anti Affinity
>             path: antiAffinity
>             value: false
>             x-descriptors:
>               - 'urn:alm:descriptor:com.tectonic.ui:booleanSwitch'
>           - description: >-
>               Specifies if update notifications will be displayed in the
>               Couchbase UI.
>             displayName: Show Update Notifications
>             path: softwareUpdateNotifications
>             value: false
>             x-descriptors:
>               - 'urn:alm:descriptor:com.tectonic.ui:booleanSwitch'
>           - description: Specifies if the Operator will create or delete
> buckets.
>             displayName: Disable Bucket Management
>             path: disableBucketManagement
>             value: false
>             x-descriptors:
>               - 'urn:alm:descriptor:com.tectonic.ui:booleanSwitch'
> 
> but when create the Couchbase Cluster instance, and check the instance
> overview page:
> 
> we found the default value for  "Expose Console"  is true.
> 
> 4.3.0-0.nightly-2020-02-07-003021

In my testing, the bug is fixed.  With Couchbase, `exposeAdminConsole` is being explicitly set to true in the included example [1], hence the booleanSwitch showing a value of true.

[1] 
apiVersion: couchbase.com/v1
kind: CouchbaseCluster
metadata:
  name: cb-example
  namespace: robb
spec:
  adminConsoleServiceType: NodePort
  exposedFeatureServiceType: NodePort
  adminConsoleServices:
    - data
  authSecret: cb-example-auth
  baseImage: registry.connect.redhat.com/couchbase/server
  buckets:
    - conflictResolution: seqno
      enableFlush: true
      enableIndexReplica: false
      evictionPolicy: fullEviction
      ioPriority: high
      memoryQuota: 128
      name: default
      replicas: 1
      type: couchbase
      compressionMode: passive
  cluster:
    analyticsServiceMemoryQuota: 1024
    autoFailoverMaxCount: 3
    autoFailoverOnDataDiskIssues: true
    autoFailoverOnDataDiskIssuesTimePeriod: 120
    autoFailoverServerGroup: false
    autoFailoverTimeout: 120
    dataServiceMemoryQuota: 256
    eventingServiceMemoryQuota: 256
    indexServiceMemoryQuota: 256
    indexStorageSetting: memory_optimized
    searchServiceMemoryQuota: 256
  exposeAdminConsole: true
  servers:
    - name: all_services
      services:
        - data
        - index
        - query
        - search
        - eventing
        - analytics
      size: 3
  version: 6.0.1-1

Comment 6 shahan 2020-02-17 01:34:02 UTC
Thanks.
all booleanSwitch default to false in the csv.
Verified this bug.
4.3.0-0.nightly-2020-02-07-003021

Comment 9 errata-xmlrpc 2020-02-25 06:18:00 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:0528