helm / helm

The Kubernetes Package Manager
https://helm.sh
Apache License 2.0
26.77k stars 7.07k forks source link

helm litters CWD if the path in $HELM_HOME/repositories/repository.yaml is not absolute. #1974

Closed AmandaCameron closed 7 years ago

AmandaCameron commented 7 years ago

When I run helm dep up I'm getting various -index.yaml files littered in my CWD, I'm told these should be going into the HELM_HOME however I don't have that set, so it seems something's not respecting the default properly.

mboersma commented 7 years ago

I am seeing similar behavior although I'm running helm repo up and my $HELM_HOME is set:

$ helm version
Client: &version.Version{SemVer:"v2.2.0", GitCommit:"fc315ab59850ddd1b9b4959c89ef008fef5cdf89", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.2.0", GitCommit:"fc315ab59850ddd1b9b4959c89ef008fef5cdf89", GitTreeState:"clean"}
$ env | grep HELM
HELM_HOME=/Users/matt/.helm
$ git status
On branch fix-hardcoded-namespace
nothing to commit, working tree clean
$ helm repo up
Hang tight while we grab the latest from your chart repositories...
...Skip local chart repository...Successfully got an update from the "stable" chart repository
...Successfully got an update from the "deis-staging" chart repository
...Successfully got an update from the "deis-dev" chart repository
...Successfully got an update from the "deis-e2e" chart repository
...Successfully got an update from the "workflow-migration" chart repository
...Successfully got an update from the "deis" chart repository
Update Complete. ⎈ Happy Helming!⎈ 
$ git status
On branch fix-hardcoded-namespace
Untracked files:
  (use "git add <file>..." to include in what will be committed)

    deis-dev-index.yaml
    deis-e2e-index.yaml
    deis-index.yaml
    deis-staging-index.yaml
    stable-index.yaml
    workflow-migration-index.yaml
mboersma commented 7 years ago

As a workaround, removing $HOME/.helm and starting from a new helm init seems to fix things.

AmandaCameron commented 7 years ago

That seems to have been the key: my existing repositories.yaml contains:

apiVersion: v1
generated: 2017-02-02T11:10:43.532717152-05:00
repositories:
- cache: stable-index.yaml
  name: stable
  url: https://kubernetes-charts.storage.googleapis.com/
- cache: local-index.yaml
  name: local
  url: http://127.0.0.1:8879/charts
- cache: deis-index.yaml
  name: deis
  url: https://charts.deis.com/workflow
- cache: incubator-index.yaml
  name: incubator
  url: https://kubernetes-charts-incubator.storage.googleapis.com/

the new one has absolute paths.

technosophos commented 7 years ago

I have located the issue. A change to the SSL subsystem also had a change to the way paths were generated for the repo file. I didn't catch it during code review. Fixing now.