Bug 1854198 - String array fields don't show descriptions defined in the schema
Summary: String array fields don't show descriptions defined in the schema
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.6.0
Assignee: Jon Jackson
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks: 1861433
TreeView+ depends on / blocked
 
Reported: 2020-07-06 18:06 UTC by Jessica Forrester
Modified: 2020-10-27 16:12 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Operand form array and object fields did not have logic to retrieve and show field descriptions on the form. Consequence: No descriptions were rendered for array or object type fields. Fix: Add logic to display array and object field descriptions on the operand creation form Result: Object and array fields now show descriptions.
Clone Of:
: 1861433 (view as bug list)
Environment:
Last Closed: 2020-10-27 16:12:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
keycloak extension field (14.59 KB, image/png)
2020-07-06 18:06 UTC, Jessica Forrester
no flags Details
Description shown (231.67 KB, image/png)
2020-08-03 06:53 UTC, Yadan Pei
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 6054 0 None closed Bug 1854198: Improve handling of descriptions in DynamicForm field components 2020-08-27 20:47:24 UTC
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 16:12:46 UTC

Description Jessica Forrester 2020-07-06 18:06:19 UTC
Created attachment 1700059 [details]
keycloak extension field

I installed Red Hat Single Sign-On operator and created a Keycloak resource. One of the fields in the schema is an array of strings. The schema in the CRD provides a description for this field, but the form does not show the description. See screenshot of how the field renders.

Relevant part of the schema:
        spec:
          description: KeycloakSpec defines the desired state of Keycloak
          type: object
          properties:
            extensions:
              description: >-
                A list of extensions, where each one is a URL to a JAR files
                that will be deployed in Keycloak.
              type: array
              items:
                type: string

Comment 1 Jon Jackson 2020-07-07 14:12:07 UTC
Didn't get a chance to look into this yet, will take a look next sprint.

Comment 4 Yadan Pei 2020-08-03 06:53:34 UTC
Created attachment 1703233 [details]
Description shown

Comment 5 Yadan Pei 2020-08-03 06:59:12 UTC
1. Prepare test files

$ cat > test.yaml << EOF
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: mock-k8s-array-resources.test.tectonic.com
spec:
  group: test.tectonic.com
  version: v1
  scope: Namespaced
  names:
    plural: mock-k8s-array-resources
    singular: mock-k8s-array-resource
    kind: MockK8sArrayResource
    listKind: MockK8sArrayResources
  validation:
    openAPIV3Schema:
      properties:
        spec:
          type: object
          properties:
            extensions:
              description: A list of extensions, where each one is a URL to a JAR fileld
              type: array
              items:
                type: string
           

---
apiVersion: operators.coreos.com/v1alpha1
kind: ClusterServiceVersion
metadata:
  name: mock-k8s-resource-array-operator
  namespace: operand-test2
  labels:
    automatedTestName: operand-test2
  annotations:
    alm-examples: '[{"apiVersion":"test.tectonic.com/v1","kind":"MockK8sArrayResource","metadata":{"name":"mock-k8s-array-resource-instance", namespace: "operand-test2"}}]'
spec:
  displayName: Mock K8sResourcePrefixOperator
  install:
    strategy: deployment
    spec:
      permissions: []
      deployments:
        - name: test-operator
          spec:
            replicas: 1
            selector:
              matchLabels:
                name: test-operator-alm-owned
            template:
              metadata:
                name: test-operator-alm-owned
                labels:
                  name: test-operator-alm-owned
              spec:
                serviceAccountName: test-operator
                containers:
                  - name: test-operator
                    image: nginx
  customresourcedefinitions:
    owned:
      - name: mock-k8s-array-resources.test.tectonic.com
        version: v1
        kind: MockK8sArrayResource
        displayName: Mock Resource
        description: Mock resource instance for testing descriptons of array field
        resources: []
        specDescriptors:
          - path: k8sResourcePrefix
            description: Spec descriptor for k8sResourcePrefix Array field
            displayName: Descriptor Generated K8s Resource Prefix Array field
            x-descriptors:
              - "urn:alm:descriptor:io.kubernetes:test.tectonic.com:v1:MockK8sArrayResource"
---
apiVersion: test.tectonic.com/v1
kind: MockK8sArrayResource
metadata:
  name: mock-k8s-array-resource-instance-1
  namespace: operand-test2
EOF
$ oc new-project operand-test2
$ oc create -f test.yaml

2. Installed Operators -> Mock K8sResourcePrefixOperator -> click on 'Create MockK8sArrayResource' button -> in the form view, we can see the description for 'Extension' field is shown correctly(see screenshot)

Verified on     4.6.0-0.nightly-2020-08-02-091622

Comment 7 errata-xmlrpc 2020-10-27 16:12:24 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 (OpenShift Container Platform 4.6 GA Images), 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:4196


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