From a27e23990eb08ee61239cb0fd991b5daa031d9f5 Mon Sep 17 00:00:00 2001 From: vaikas-google Date: Mon, 16 May 2016 17:24:02 -0700 Subject: [PATCH] offset all the directories and files to $HELM_HOME/repository from $HELM_HOME --- cmd/helm/init.go | 2 +- cmd/helm/structure.go | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cmd/helm/init.go b/cmd/helm/init.go index 136c95ceb..de44a68de 100644 --- a/cmd/helm/init.go +++ b/cmd/helm/init.go @@ -74,7 +74,7 @@ func installTiller() error { // // If $HELM_HOME does not exist, this function will create it. func ensureHome() error { - configDirectories := []string{homePath(), cacheDirectory(), localRepoDirectory()} + configDirectories := []string{homePath(), repositoryDirectory(), cacheDirectory(), localRepoDirectory()} for _, p := range configDirectories { if fi, err := os.Stat(p); err != nil { diff --git a/cmd/helm/structure.go b/cmd/helm/structure.go index e6fe9a482..7468b36f8 100644 --- a/cmd/helm/structure.go +++ b/cmd/helm/structure.go @@ -6,6 +6,7 @@ import ( ) const ( + repositoryDir string = "repository" repositoriesFilePath string = "repositories.yaml" cachePath string = "cache" localRepoPath string = "local" @@ -16,16 +17,21 @@ func homePath() string { return os.ExpandEnv(helmHome) } +// All other directories go under the $HELM_HOME/repository. +func repositoryDirectory() string { + return homePath() + "/" + repositoryDir +} + func cacheDirectory(paths ...string) string { - fragments := append([]string{homePath(), cachePath}, paths...) + fragments := append([]string{repositoryDirectory(), cachePath}, paths...) return filepath.Join(fragments...) } func localRepoDirectory(paths ...string) string { - fragments := append([]string{homePath(), localRepoPath}, paths...) + fragments := append([]string{repositoryDirectory(), localRepoPath}, paths...) return filepath.Join(fragments...) } func repositoriesFile() string { - return filepath.Join(homePath(), repositoriesFilePath) + return filepath.Join(repositoryDirectory(), repositoriesFilePath) }