helm-classic icon indicating copy to clipboard operation
helm-classic copied to clipboard

Charts directory collision when using multiple repositories.

Open migmartri opened this issue 8 years ago • 4 comments

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?

migmartri avatar Mar 17 '16 09:03 migmartri

The namespacing/uninstall issue in https://github.com/helm/helm/issues/392 might serve as a template for addressing this?

nomisbeme avatar Mar 21 '16 23:03 nomisbeme

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 avatar Mar 22 '16 16:03 krancour

@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 avatar Mar 22 '16 17:03 prydonius

@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.

krancour avatar Mar 22 '16 17:03 krancour