sonatype-nexus-community / nexus-repository-helm

At the Helm, Helm Yeah, v k8s
Eclipse Public License 1.0
97 stars 71 forks source link

urls field generation hardcoded in index.yaml #94

Closed verhyppo closed 4 years ago

verhyppo commented 4 years ago

When retrieving the index.yaml from hosted or proxy repositories, urls for entries contains only the artifact name. The actual behaviuor should be similar to:

entries:
  <name>:
  - apiVersion: v1
    appVersion: <app-version>
    [OMITTED FOR BREVITY] 
    urls:
    - https://<host and path for chart repository>/<name>-<version>.tgz
    version: <version>

this result on helm charts repository is usually achieved using the following command: helm repo index <local-repo-folder> --url https://<host and path for chart repository>/ This way, the index is generated prepending --url value to all charts in the urls field of the index.yaml

It seems that url are generated statically by org.sonatype.repository.helm.internal.createindex.CreateIndexServiceImpl#createListOfRelativeUrls that does not take host url. Also, it seems that there is no host configuration in the administration panel to allow also the use of proxy pass.

mlukaretkyi commented 4 years ago

Hi. Yes, you are absolutely right about hardcoded in index.yaml, but it was done for certain reasons. So, I can give you advice about your problem. You have NXRM URL and uploaded index.yaml from the repo, so you can get a chart and concatenate nxrm_url + chart and it will be URL that you need

verhyppo commented 4 years ago

Many thanks for your advice, this is the same solution that I had in mind. Since there is a reason behind the actual implementation in the plugin, I think is ok to close here the issue, can you please briefly explaining the reasons behind?

Thanks for the effort in this plugin, it's very appreciated!

mlukaretkyi commented 4 years ago

Thanks for your interesting. The main reason. If NXRM moves to another host, metadata will be invalid, I mean URLS in index.yaml. We can implement this behavior, but this implementation requires the following behavior from NXRM. NXRM has to recalculate all metadata after launch. I guess concatenate NXRM_url + chart_name_version will be much easier than implementation with metadata recalculate. Also, I found the same issue https://github.com/sonatype-nexus-community/nexus-repository-helm/issues/1