Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-28392

helm-hosted: the order of "version" in index.yaml should be most recent to oldest

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.32.0
    • Fix Version/s: None
    • Component/s: helm
    • Labels:
    • Notability:
      3

      Description

      ISSUE:

      The default version used by helm clients seems to pick the first version in the index.yaml (eg. Rancher, Lens).
      Also, by looking at some index.yaml used in the remote site (eg. Bitnami), it's also sorted by the "version" as semver.
      But the index.yaml generated by Nexus looks like alphabetical order (old one first), so that users need to be careful to install package from Nexus helm hosted repository.

      REPRODUCE STEPS:

      1. Create a helm-hosted repo
      2. Download test packages:
        curl -O https://charts.bitnami.com/bitnami/node-11.4.13.tgz
        curl -O https://charts.bitnami.com/bitnami/node-11.4.15.tgz
      3. Upload above two package (order doesn't matter)
        curl -v -u admin:admin123 "http://localhost:8081/repository/helm-hosted/" -T node-11.4.13.tgz
        curl -v -u admin:admin123 "http://localhost:8081/repository/helm-hosted/" -T node-11.4.15.tgz
      4. Check the http://localhost:8081/repository/helm-hosted/index.yaml

      EXPECTED BEHAVIOUR:

      Newer version (11.4.15) should be the top of index.yaml.

      ACTUAL BEHAVIOUR

      Older version (11.4.13) shows in the top, so that when user try to install this "node", the default version is set to 11.4.13:

      POTENTIAL CAUSE:

      Currently, it seems the order is decided by the index set on the "asset" class in OrientDB, as Nexus does not sort in CreateIndexServiceImpl#buildIndexYaml, and just use the result of "select from asset where (component IS NOT NULL AND attributes.helm.asset_kind = 'HELM_PACKAGE') and (bucket=xxxx)" (no order specified)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              hosako Hajime Osako
              CC:
              System Management
              Last Updated By:
              Michael Oliverio Michael Oliverio
              Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response:

                  tigCommentSecurity.panel-title