helm-classic
helm-classic copied to clipboard
Charts directory collision when using multiple repositories.
Hi
Two chart with the same name but in different repositories seems to use the same workspace chart directory.
$ helm fetch redmine
---> Fetched chart into workspace /home/migmartri/.helm/workspace/charts/redmine
---> Done
$ ls ~/.helm/workspace/charts/redmine/manifests/
redmine-rc.yaml redmine-svc.yaml
$ helm repo add bitnami https://github.com/bitnami/charts
---> Cloning into '/home/migmartri/.helm/cache/bitnami'...
---> Hooray! Successfully added the repo.
$ helm fetch bitnami/redmine
---> Fetched chart into workspace /home/migmartri/.helm/workspace/charts/redmine
---> Done
$ ls ~/.helm/workspace/charts/redmine/manifests/
redmine-rc.yaml redmine-svc.yaml redmine-controller.yaml redmine-service.yaml
Both charts have been fetched in the same directory. Causing some unexpected behavior:
-
If the k8s files have the same name, they will get overridden.
-
If the k8s files have different name, they will be placed next to the previous ones, adding unexpected resources to the deployment or causing installation errors.
helm install bitnami/redmine ---> Running `kubectl create -f` ... Error from server: error when creating "STDIN": services "redmine" already exists
One proposed solution would be that the workspace directory is namespaced with the repository name for personal repos.
This will result in the following directory structure:
~/.helm/workspace/charts/redmine/
~/.helm/workspace/charts/bitnami/redmine/
Thoughts?
The namespacing/uninstall issue in https://github.com/helm/helm/issues/392 might serve as a template for addressing this?
Similar to when you clone a git repository and may be wishing to avoid a naming conflict, you can specify your own name for a chart in your workspace at the time you fetch it.
Example:
$ helm fetch redmine
$ helm fetch bitnami/redmine bitnami-redmine
@krancour that works if you're aware of what the default behaviour is, for me this wasn't completely obvious and it wasn't immediately clear what had happened. I think being consistent with the charts repo namespace across all commands avoids a lot of confusion.
@prydonius I should be clear... I never meant to imply improvements aren't possible in this regard. I was only suggesting an expedient workaround for anyone facing this issue at the moment.