Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-15720

Helm Chart installation form hangs on create if JSON-schema is using 2019-09 or 2020-20 standard revisions

XMLWordPrintable

    • No
    • ODC Sprint 241
    • 1
    • Rejected
    • False
    • Hide

      None

      Show
      None

      This is a clone of issue OCPBUGS-14874. The following is the description of the original issue:

      Description of problem:

      Deploying a helm chart that features a values.schema.json using either 2019-09 or 2020-20 (latest) revisions of the JSON-Schema results in the UI hanging on create with three dots loading... This is not the case if YAML view is used, since I suppose this view is not trying to be clever and let Helm validate the chart values against the schema itself.

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

      Reproduced in 4.13, probably affects other versions as well.

      How reproducible:

      100%

      Steps to Reproduce:

      1. Go to Helm tab.
      2. Click create in top right and select Repository
      3. Paste following into YAML view and click Create:

      apiVersion: helm.openshift.io/v1beta1
      kind: ProjectHelmChartRepository
      metadata:
        name: reproducer
      spec:
        connectionConfig:
          url: 'https://raw.githubusercontent.com/tumido/helm-backstage/blog2'
      

      4. Go to the Helm tab again (if redirected elsewhere)
      5. Click create in top right and select Helm Release
      6. In catalog filter select Chart repositories: Reproducer
      7. Click on the single tile available (Backstage) and click Create
      8. Switch to Form view
      9. Leave default values and click Create
      10. Stare at the always loading screen that never proceeds further.

      Actual results:

      Expected results:

      It installs and deploys the chart

      Additional info:

      This is caused by a JSON Schema containing a $schema key pointing which revision of the JSON Schema standard should be used:

      {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
      }
      

      I've managed to trace this back to this react-jsonschema-form issue:

      https://github.com/rjsf-team/react-jsonschema-form/issues/2241

      It seems the library used here for validation doesn't support 2019-09 draft and the most current revision 2020-20 revision.

      It happens only if the chart follows the JSON Schema standard and declares the revision properly.

      Workarounds:

      IMO best solution:
      Helm form renderer should NOT do any validation, since it can't handle the schema properly. Instead, it should leave this job to the Helm backend. Helm validates the values against the schema when installing the chart anyways. The YAML view also does no validation. That one seems to do the job properly.
       
      Currently, there is no formal requirement for charts admitted to the helm curated catalog saying that the most recent JSON Schema revision is 4 years old and later 2 revisions are not supported.

      Also, the Form UI should not just hang on submit. Instead, it should at least fail gracefully.

       

      Related to:

      https://github.com/janus-idp/helm-backstage/issues/64#issuecomment-1587678319

              rh-ee-lprabhu Lokananda Prabhu
              tcoufal@redhat.com Tom Coufal
              Sanket Pathak Sanket Pathak
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: