Update docs, add warning and install xdg-go package

Signed-off-by: Alexander Nesterenko <nestorf250@gmail.com>
pull/5166/head
Alexander Nesterenko 7 years ago
parent 499269e181
commit de37b7ade1

9
Gopkg.lock generated

@ -123,6 +123,14 @@
revision = "ccb8e960c48f04d6935e72476ae4a51028f9e22f" revision = "ccb8e960c48f04d6935e72476ae4a51028f9e22f"
version = "v9" version = "v9"
[[projects]]
branch = "master"
digest = "1:ef3589c5082eac12d04efdeca6dab7f8bac2d10bac4cfdbe51b252e4022b535a"
name = "github.com/casimir/xdg-go"
packages = ["."]
pruneopts = "UT"
revision = "372ccc2180dab73316615641d5617c5ed3e35529"
[[projects]] [[projects]]
branch = "master" branch = "master"
digest = "1:d6afaeed1502aa28e80a4ed0981d570ad91b2579193404256ce672ed0a609e0d" digest = "1:d6afaeed1502aa28e80a4ed0981d570ad91b2579193404256ce672ed0a609e0d"
@ -1624,6 +1632,7 @@
"github.com/docker/distribution/registry", "github.com/docker/distribution/registry",
"github.com/docker/distribution/registry/storage/driver/inmemory", "github.com/docker/distribution/registry/storage/driver/inmemory",
"github.com/docker/go-units", "github.com/docker/go-units",
"github.com/casimir/xdg-go",
"github.com/evanphx/json-patch", "github.com/evanphx/json-patch",
"github.com/ghodss/yaml", "github.com/ghodss/yaml",
"github.com/gobwas/glob", "github.com/gobwas/glob",

@ -54,6 +54,10 @@
name = "github.com/stretchr/testify" name = "github.com/stretchr/testify"
version = "^1.3.0" version = "^1.3.0"
[[constraint]]
branch = "master"
name = "github.com/casimir/xdg-go"
[[override]] [[override]]
name = "k8s.io/apiserver" name = "k8s.io/apiserver"
branch = "release-1.13" branch = "release-1.13"

@ -36,7 +36,7 @@ import (
) )
const initDesc = ` const initDesc = `
This command sets up local configuration in $HELM_HOME (default ~/.helm/). This command sets up local configuration in $HELM_HOME (default $XDG_CONFIG_DIR/helm/).
` `
const ( const (

@ -44,7 +44,11 @@ Common actions from this point include:
- helm list: list releases of charts - helm list: list releases of charts
Environment: Environment:
$HELM_HOME set an alternative location for Helm files. By default, these are stored in ~/.helm $HELM_HOME set an alternative location for Helm files. By default, these are stored in
"$XDG_CONFIG_DIR/helm"" on *nix, "%APPDATA%\helm" on Windows and
"$HOME/Library/Preferences" on OSX.
NOTE: if you have old-style "~/.helm" directory, it will be used, but consider
moving it to a new home.
$HELM_DRIVER set the backend storage driver. Values are: configmap, secret, memory $HELM_DRIVER set the backend storage driver. Values are: configmap, secret, memory
$HELM_NO_PLUGINS disable plugins. Set HELM_NO_PLUGINS=1 to disable plugins. $HELM_NO_PLUGINS disable plugins. Set HELM_NO_PLUGINS=1 to disable plugins.
$KUBECONFIG set an alternative Kubernetes configuration file (default "~/.kube/config") $KUBECONFIG set an alternative Kubernetes configuration file (default "~/.kube/config")

@ -34,7 +34,7 @@ func TestRootCmd(t *testing.T) {
{ {
name: "defaults", name: "defaults",
args: "home", args: "home",
home: filepath.Join(homedir.HomeDir(), ".helm"), home: filepath.Join(homedir.HomeDir(), ".config/helm"),
}, },
{ {
name: "with --home set", name: "with --home set",

@ -23,6 +23,7 @@ These dependencies are expressed as interfaces so that alternate implementations
package environment package environment
import ( import (
"fmt"
"github.com/casimir/xdg-go" "github.com/casimir/xdg-go"
"os" "os"
"path/filepath" "path/filepath"
@ -33,7 +34,6 @@ import (
"k8s.io/helm/pkg/helm/helmpath" "k8s.io/helm/pkg/helm/helmpath"
) )
var oldDefaultHelmHome = filepath.Join(homedir.HomeDir(), ".helm") var oldDefaultHelmHome = filepath.Join(homedir.HomeDir(), ".helm")
var defaultHelmHome = filepath.Join(xdg.ConfigHome(), "helm") var defaultHelmHome = filepath.Join(xdg.ConfigHome(), "helm")
@ -46,7 +46,7 @@ func getDefaultConfigHome() string {
} else if _, err := os.Stat(oldDefaultHelmHome); err != nil { } else if _, err := os.Stat(oldDefaultHelmHome); err != nil {
return defaultHelmHome return defaultHelmHome
} }
// TODO: Write a warning to output fmt.Printf("WARNING: using old-style configuration directiry. Please, consider moving it to %s\n", defaultHelmHome)
return oldDefaultHelmHome return oldDefaultHelmHome
} }

@ -40,8 +40,8 @@ func TestEnvSettings(t *testing.T) {
}{ }{
{ {
name: "defaults", name: "defaults",
home: oldDefaultHelmHome, home: defaultHelmHome,
plugins: helmpath.Home(oldDefaultHelmHome).Plugins(), plugins: helmpath.Home(defaultHelmHome).Plugins(),
ns: "", ns: "",
}, },
{ {

Loading…
Cancel
Save