Bug 2003145

Summary: Duplicate operand tab titles causes "two children with the same key" warning
Product: OpenShift Container Platform Reporter: Samuel Padgett <spadgett>
Component: Management ConsoleAssignee: Kim Dobestein <kdoberst>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.9CC: aos-bugs, jhadvig, yapei
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Version: 4.9.0-0.nightly-2021-09-09-145014 Cluster ID: bdd1048c-9e09-40a2-b775-b550d8c14f47 Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Firefox/91.0
Last Closed: 2022-03-10 16:09:11 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 Samuel Padgett 2021-09-10 12:42:00 UTC
We should generate unique keys for the tabs even when two tabs have the same display name.

Note: Bug 1991702 already tracks the fact that two tabs with the same name exist for the Service Binding operator. This bug is not to fix the operator, rather make sure we're generating unique keys when we encounter this case.

Warning: Encountered two children with the same key, `Service Binding`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
ul
./public/components/utils/horizontal-nav.tsx/</_c<@http://localhost:9000/static/main-a828c30ef03f0763a16f.js:149944:95

Comment 4 Yadan Pei 2021-10-09 06:50:28 UTC
1. Build an operator whose owned CRD have the same displayName.

For example in this case, customresource EtcdCluster and EtcdBackup have the same displayName 'etcd Cluster YAPEI'

$ sed -n '27,100p' etcdoperator.v0.9.4.clusterserviceversion.yaml
spec:
  customresourcedefinitions:
    owned:
    - description: Represents a cluster of etcd nodes.
      displayName: etcd Cluster YAPEI
      kind: EtcdCluster
      name: etcdclusters.etcd.database.coreos.com
      resources:
      - kind: Service
        version: v1
      - kind: Pod
        version: v1
      specDescriptors:
      - description: The desired number of member Pods for the etcd cluster.
        displayName: Size
        path: size
        x-descriptors:
        - urn:alm:descriptor:com.tectonic.ui:podCount
      - description: Limits describes the minimum/maximum amount of compute resources
          required/allowed
        displayName: Resource Requirements
        path: pod.resources
        x-descriptors:
        - urn:alm:descriptor:com.tectonic.ui:resourceRequirements
      statusDescriptors:
      - description: The status of each of the member Pods for the etcd cluster.
        displayName: Member Status
        path: members
        x-descriptors:
        - urn:alm:descriptor:com.tectonic.ui:podStatuses
      - description: The service at which the running etcd cluster can be accessed.
        displayName: Service
        path: serviceName
        x-descriptors:
        - urn:alm:descriptor:io.kubernetes:Service
      - description: The current size of the etcd cluster.
        displayName: Cluster Size
        path: size
      - description: The current version of the etcd cluster.
        displayName: Current Version
        path: currentVersion
      - description: The target version of the etcd cluster, after upgrading.
        displayName: Target Version
        path: targetVersion
      - description: The current status of the etcd cluster.
        displayName: Status
        path: phase
        x-descriptors:
        - urn:alm:descriptor:io.kubernetes.phase
      - description: Explanation for the current status of the cluster.
        displayName: Status Details
        path: reason
        x-descriptors:
        - urn:alm:descriptor:io.kubernetes.phase:reason
      version: v1beta2
    - description: Represents the intent to backup an etcd cluster.
      displayName: etcd Cluster YAPEI
      kind: EtcdBackup
      name: etcdbackups.etcd.database.coreos.com
      specDescriptors:
      - description: Specifies the endpoints of an etcd cluster.
        displayName: etcd Endpoint(s)
        path: etcdEndpoints
        x-descriptors:
        - urn:alm:descriptor:etcd:endpoint
      - description: The full AWS S3 path where the backup is saved.
        displayName: S3 Path
        path: s3.path
        x-descriptors:
        - urn:alm:descriptor:aws:s3:path
      - description: The name of the secret object that stores the AWS credential
          and config files.
        displayName: AWS Secret
        path: s3.awsSecret
        x-descriptors:
        - urn:alm:descriptor:io.kubernetes:Secret
      statusDescriptors:
      - description: Indicates if the backup was successful.
        displayName: Succeeded
        path: succeeded
        x-descriptors:
        - urn:alm:descriptor:text
      - description: Indicates the reason for any backup related failures.
        displayName: Reason
        path: reason
        x-descriptors:
        - urn:alm:descriptor:io.kubernetes.phase:reason
      version: v1beta2
2. create a catalogsource with customized operator index image, wait for operator package manifests generated
3. Install etcd operator from OperatorHub, wait until operator is successfully installed
4. Goes to Installed Operators page and operator details page, two tabs with exact same name 'etcd Cluster YAPEI' is shown, inspect browser console and didn't see `Warning: Encountered two children with the same key` message

Verified on 4.10.0-0.nightly-2021-10-08-090421

Comment 5 Yadan Pei 2021-10-09 06:51:57 UTC
note to myself: the operator index image used for verification is quay.io/yapei/etcd-index-dup:latest

Comment 9 errata-xmlrpc 2022-03-10 16:09:11 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.10.3 security 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-2022:0056