debben / vsts-helm-extension

An unofficial Helm extension for Visual Studio Team Services
MIT License
4 stars 1 forks source link

helm repo add fails #7

Closed mmisztal1980 closed 6 years ago

mmisztal1980 commented 6 years ago

Note: for support questions specific to Helm, please use see the Helm documentation. This repository's issues are reserved for feature requests and bug reports.

debben commented 6 years ago

Helm by default writes this information to ~/.helm/repository/repositories.yaml. This directory is likely restricted on the shared build agents. The Helm client will respect the HELM_HOME environment variable so try setting this to a location that is accessible (such as $(System.DefaultWorkingDirectory)). Keep in mind that this state will likely not persist between builds.

mmisztal1980 commented 6 years ago

Hi,

I've added a preceeding bash step, which would export HELM_HOME=$(System.DefaultWorkingDirectory) however the error persists.

Either I'm doing something wrong, or this issue is not related to HELM_HOME (I've got a preceeding helm init step and it works fine - for what it's worth).

mmisztal1980 commented 6 years ago

I've modified the bash task to do the following:

Task Inline Bash

# Write your commands here
export HELM_HOME=$(System.DefaultWorkingDirectory)
echo $HELM_HOME
ls -l $(System.DefaultWorkingDirectory)

Output

2018-04-15T18:54:38.1611180Z ##[section]Starting: [bash] export HELM_HOME
2018-04-15T18:54:38.2283250Z ==============================================================================
2018-04-15T18:54:38.2426790Z Task         : Bash
2018-04-15T18:54:38.2561120Z Description  : This is an early preview. Run a Bash script on macOS, Linux, or Windows
2018-04-15T18:54:38.2696980Z Version      : 3.127.0
2018-04-15T18:54:38.2846320Z Author       : Microsoft Corporation
2018-04-15T18:54:38.2996680Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613738)
2018-04-15T18:54:38.3141000Z ==============================================================================
2018-04-15T18:54:40.5831890Z Generating script.
2018-04-15T18:54:40.8053540Z [command]/bin/bash --noprofile --norc /Users/vsts/agent/2.131.0/work/_temp/569cb774-0be0-487c-8e1f-b6cc3c1d7ad1.sh
2018-04-15T18:54:40.8224150Z /Users/vsts/agent/2.131.0/work/r1/a
2018-04-15T18:54:40.8355800Z total 0
2018-04-15T18:54:40.8526740Z drwxr-xr-x  9 vsts  staff  306 Apr 15 18:53 inf-k8s-services
2018-04-15T18:54:40.8735460Z drwxr-xr-x  6 vsts  staff  204 Apr 15 18:53 undefined
2018-04-15T18:54:40.9278630Z ##[section]Finishing: [bash] export HELM_HOME

What catches my eye is the undefined directory in the $HELM_HOME, it also appears in the original error message : undefined/repository/cache/undefined/repository/cache/rook-master-index.yaml: no such file or directory. Are you sure it's not coming from the extension's transpiled .ts code?

debben commented 6 years ago

Worth noting too that Helm home directory can also be configured with the "--home" global flag.

mmisztal1980 commented 6 years ago

Let me try that

mmisztal1980 commented 6 years ago

@debben providing HELM_HOME via the --home flag seems to have solved the issue.

Thanks!