infinispan / infinispan-helm-charts

Apache License 2.0
13 stars 26 forks source link

Using Infinispan chart as a dependency in helm chart #60

Closed ehsantashkhisi closed 3 months ago

ehsantashkhisi commented 1 year ago

When I use Infinispan chart as a dependency in my helm chart I get the following error:

Error: INSTALLATION FAILED: found in Chart.yaml, but missing in charts/ directory: infinispan-infinispan

Steps to reproduce:

  1. Add the following line to any chart:
    dependencies:
    - name: infinispan-infinispan
    alias: infinispan
    version: 0.3.0
    repository: https://charts.openshift.io/
  2. Run helm dependency update
  3. Run helm install command.

Why:

Based on my investigation it is because the name of the chart is infinispan but as a dependency, we use the infinispan-infinispan name. I could not find any work around, I think it should be solved in the infinispan chart itself.

ryanemerson commented 1 year ago

@ehsan-tashkhisi Unfortunately this is a limitation with Helm and the way charts.openshift.io packages the charts in order to prevent multiple vendors supplying charts with the same name, e.g. mysql.

https://github.com/helm/helm/issues/11010

The current workaround is to:

  1. Execute helm dependency update to pull the infinispan-infinispan chart
  2. Rename charts/infinispan-infinispan-0.3.0.tgz to charts/infinispan-0.3.0.tgz
  3. Change:
dependencies:
  - name: infinispan-infinispan

to

dependencies:
  - name: infinispan

This will make helm install succeed, but subsequent calls to helm dependency update will fail :disappointed:

ehsantashkhisi commented 1 year ago

@ryanemerson Thanks for the answer, I think this problem should be solved in the charts.openshift.io repository. This would be a hassle for developers who are going to use this chart as a dependency, I am currently using this workaround but it is not clean and make managing dependencies difficult or impossible in the future, It would be appreciated by developers if you fix this problem in charts.openshift.io repository. I also created the following issue in the helm repo to receive some feedback. https://github.com/helm/helm/issues/11643

Here is the reason for the criticality of the problem:

Downloading the dependency manually and renaming it after the download would solve the problem, but to my mind that is not clean, what if we want to add another dependency in the future, if we go with this approach I have to add the charts directory to source control and I would not be able to run helm dep up in CI/CD anymore, dependencies can not be managed by helm from that point and I have to manage all the dependencies manually.

ryanemerson commented 1 year ago

I appreciate this is far from ideal.

Having spoken with the maintainers of charts.openshift.io, they have received little to no traction in their efforts to solve this upstream in Helm itself. Their intention is to start leveraging an OCI based repository which will ultimately resolve this issue.

sruthiravula commented 11 months ago

I am trying to use this chart and facing same issue, any update on this is highly appreciated! Thanks

ryanemerson commented 11 months ago

Unfortunately there hasn't been any progress. Ultimately the issue is caused by charts.openshift.io and their naming convention. Below are the relevant tracker issues:

https://github.com/openshift-helm-charts/charts/issues/655 https://github.com/openshift-helm-charts/charts/issues/773

mgoerens commented 3 months ago

@ryanemerson Note that charts.openshift.io has now fixed the issue. https://github.com/openshift-helm-charts/charts/issues/773 is completed and consequently this issue should also now be solved. Please let us (maintainers of charts.openshift.io) now if you're still running into any issues.

ryanemerson commented 3 months ago

Note for anyone affected by this issue, it's now possible to consume the Infinispan chart as a dependency. To do this you need the following in your Chart.yaml:

dependencies:
  - name: infinispan
    version: 0.4.0
    repository: https://charts.openshift.io/

Thanks @mgoerens