Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-26110

Deploying Helm Charts with long Description section in Chart.yaml causes indexing issues with virtual and local repo

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: 4 - Normal
    • Resolution: Unresolved
    • Affects Version/s: 7.21.3
    • Fix Version/s: None
    • Component/s: Artifactory, Helm
    • Labels:
      None
    • Location:
      External

      Description

      Problem Description:
      If you deploy a helm chart with a long description (and likely other fields), there will be an issue with generating the index.yaml for a virtual repo:

      Chart.yaml snippet of deployed chart:

      description: 'deployment.redacted.redacted.com/metadata:   displayName: redacted Load Core Agent   nameType: NAME   namespace: redacted-loadcore-agent   provides:     - name: load-core-agent       version: 2.1   requires: []   deployOptions:     skipDryRun: true '
      
      

      The generated index.yaml for the local repo will look contain:

      description: "deployment.redacted.redacted.com/metadata:   displayName: redacted Load\
            \ Core Agent   nameType: NAME   namespace: redacted-loadcore-agent   provides:\
            \     - name: load-core-agent       version: "2.1   requires: []   deployOptions:"
            \     skipDryRun: true "
      

      The helm virtual repo index calculation will throw the below error:

      2021-07-06T19:13:54.009Z [jfrt ] [ERROR] [e6ebb3fe8b79e046] [.a.h.r.m.HelmVirtualMerger:256] [art-exec-5109       ] - Couldn't read index file in local repository test-helm-local : while parsing a block mapping
       in 'reader', line 4, column 5:
            - apiVersion: v2
              ^
      expected <block end>, but found '<scalar>'
       in 'reader', line 9, column 53:
           ... load-core-agent       version: "2.1   requires: []   deployOptions:"
                                               ^
      
       at [Source: (org.jfrog.storage.binstore.common.ReaderTrackingInputStream); line: 9, column: 53] (through reference chain: org.jfrog.repomd.helm.model.HelmIndexYamlMetadata["entries"]->java.util.LinkedHashMap["load-core-agent"]->java.util.TreeSet[0])
      

      Trying to add the local repo as a repo with the helm client will throw:

      helm repo add test-helm http://mill.jfrog.info:16675/artifactory/test-helm-local 
      Error: looks like "http://mill.jfrog.info:16675/artifactory/test-helm-local" is not a valid chart repository or cannot be reached: error converting YAML to JSON: yaml: line 8: did not find expected key
      helm.go:81: [debug] error converting YAML to JSON: yaml: line 8: did not find expected key
      looks like "http://mill.jfrog.info:16675/artifactory/test-helm-local" is not a valid chart repository or cannot be reached
      

      It looks like Artifactory is adding extra "\" to the description.

      Steps to reproduce:
      Deploy two packages attached, and see the local repo index.yaml. Then, add the local repo to a virtual repo, and see the errors in the logs.

      Expected behavior:
      Artifactory does not add "\" in the generated index.yaml

      Workaround:
      None besides changing the Chart.yaml of the deployed chart

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            mattheww Matthew Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Sync Status

                Connection: RTFACT Sync
                RTMID-26111 -
                SYNCHRONIZED
                • Last Sync Date: