Bug 1898532 - Display names defined in specDescriptors not respected
Summary: Display names defined in specDescriptors not respected
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.7.0
Assignee: Jon Jackson
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-17 13:10 UTC by Alexandre Kieling
Modified: 2021-02-24 15:34 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Lodash startCase function was being applied to Operand form descriptor fields in some cases. Consequence: The field label would be formatted in Start Case, which would override the displayName property of the descriptor. Fix: Only apply startCase when a descriptor displayName is not provided. Result: Descriptor displayName is properly displayed on Operanmd forms.
Clone Of:
Environment:
Last Closed: 2021-02-24 15:34:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
CR creation page (54.66 KB, image/png)
2020-11-17 13:10 UTC, Alexandre Kieling
no flags Details
specDescriptor displayName is shown correctly (170.12 KB, image/png)
2020-12-07 07:32 UTC, Yadan Pei
no flags Details
specDescriptor displayName is respected (172.42 KB, image/png)
2020-12-08 02:02 UTC, Yadan Pei
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 7366 0 None closed Bug 1898532: Remove _.startCase from FieldSet title 2021-02-18 18:35:52 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:34:53 UTC

Description Alexandre Kieling 2020-11-17 13:10:47 UTC
Created attachment 1730136 [details]
CR creation page

Description of problem:

In the Golang operator, I define the following CRD Spec field:

// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="3scale APIcast Operator"
ThreeScaleAPIcastInstallationInput *ThreeScaleAPIcastInstallationInput `json:"3scale-apicast-installation,omitempty"`

Which gets translated into the following CSV specDescriptor:

- displayName: 3scale APIcast Operator
  path: 3scale-apicast-installation

In the OpenShift console, the display name is changed to "3 Scale AP Icast Operator".


Steps to Reproduce:
1. Create a Go based operator and define an API Spec field with the following markers:
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="3scale APIcast Operator"
2. Deploy the operator to OperatorHub
3. Install the operator
4. Go to the CR creation page

Actual results:

In the CR creation page, the dynamically generated form shows the field with the following label: "3 Scale AP Icast Operator".

Expected results:

Expected to see the defined display name: "3scale APIcast Operator".

Additional info:

Comment 2 Yadan Pei 2020-12-07 07:32:31 UTC
Created attachment 1737209 [details]
specDescriptor displayName is shown correctly

1. Install Red Hat Integration - 3scale operator from OperatorHub, wait it is successfully installed
2. Check CSV specDescriptor
# oc get csv -n test
NAME                                           DISPLAY                            VERSION                 REPLACES                 PHASE
3scale-operator.v0.6.1                         Red Hat Integration - 3scale       0.6.1                   3scale-operator.v0.6.0   Succeeded

# oc get csv 3scale-operator.v0.6.1 -n test -o json | jq '.spec.customresourcedefinitions.owned[2].specDescriptors'
[
  {
    "description": "Wildcard domain as configured in the API Manager object",
    "displayName": "Wildcard Domain",
    "path": "wildcardDomain",
    "x-descriptors": [
      "urn:alm:descriptor:com.tectonic.ui:label"
    ]
  }
]

3. Change displayName in specDescriptors to `3scale APIcast Operator` and save the changes
# oc get csv 3scale-operator.v0.6.1 -n test -o json | jq '.spec.customresourcedefinitions.owned[2].specDescriptors'
[
  {
    "description": "Wildcard domain as configured in the API Manager object",
    "displayName": "3scale APIcast Operator Wildcard Domain",      // updated displayName 
    "path": "wildcardDomain",
    "x-descriptors": [
      "urn:alm:descriptor:com.tectonic.ui:label"
    ]
  }
]

4. goes to Installed Operators -> click on Red Hat Integration - 3scale -> click 'API Manager' tab and hit 'Create APIManager' button, in the form we can see the field display name is `3scale APIcast Operator Wildcard Domain` (see attachment)


Above steps are checked against 4.6.0-0.nightly-2020-12-06-095114

Comment 3 Yadan Pei 2020-12-07 07:34:31 UTC
Hi abrianik

I didn't reproduce your issue on 4.6.0-0.nightly-2020-12-06-095114 which should not have the fix, could you help check if my reproduce steps in comment 2 is correct or not?

Comment 4 Alexandre Kieling 2020-12-07 11:54:23 UTC
@yapei I wasn't able reproduce the issue using your steps but managed to reproduce it using a different Operator, the Red Hat Integration - Service Registry Operator. Try that one.

Comment 5 Yadan Pei 2020-12-08 02:02:41 UTC
Created attachment 1737471 [details]
specDescriptor displayName is respected

1. Install Red Hat Integration - Service Registry Operator
2. Update specDescriptor in CSV
# oc get csv service-registry-operator.v1.1.0 -n default -o json | jq '.spec.customresourcedefinitions.owned[0].specDescriptors'
[
  {
    "description": "Configuration",
    "displayName": "3scale APIcast Operator Configuration",
    "path": "configuration"
  },
  {
    "description": "Deployment",
    "displayName": "3scale APIcast Operator Deployment",
    "path": "deployment"
  },
  {
    "description": "Image",
    "displayName": "Image",
    "path": "image"
  }
]
3. Create instance in Form view, the display name is showing exactly the same as we defined `3scale APIcast Operator Configuration`, see attachment

Verified on 4.7.0-0.nightly-2020-12-04-013308

Comment 6 Yadan Pei 2020-12-08 02:12:20 UTC
Sorry, moving Assignee back and clear my NEEDINFO

Comment 9 errata-xmlrpc 2021-02-24 15:34: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 (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), 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/RHSA-2020:5633


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