pull/3213/merge
silenceshell 8 years ago committed by GitHub
commit 3cb06808c0

@ -173,7 +173,7 @@ func setupConnection(c *cobra.Command, args []string) error {
return err return err
} }
tunnel, err := portforwarder.New(settings.TillerNamespace, client, config) tunnel, err := portforwarder.New(settings.TillerNamespace, client, config, settings.TunnelLocalPort)
if err != nil { if err != nil {
return err return err
} }

@ -20,6 +20,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"runtime" "runtime"
"strconv"
"strings" "strings"
"testing" "testing"
@ -179,6 +180,7 @@ func TestSetupEnv(t *testing.T) {
{"HELM_PATH_STARTER", settings.Home.Starters()}, {"HELM_PATH_STARTER", settings.Home.Starters()},
{"TILLER_HOST", settings.TillerHost}, {"TILLER_HOST", settings.TillerHost},
{"TILLER_NAMESPACE", settings.TillerNamespace}, {"TILLER_NAMESPACE", settings.TillerNamespace},
{"TUNNEL_LOCAL_PORT", strconv.Itoa(settings.TunnelLocalPort)},
} { } {
if got := os.Getenv(tt.name); got != tt.expect { if got := os.Getenv(tt.name); got != tt.expect {
t.Errorf("Expected $%s=%q, got %q", tt.name, tt.expect, got) t.Errorf("Expected $%s=%q, got %q", tt.name, tt.expect, got)

@ -37,6 +37,7 @@ Environment:
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
@ -68,4 +69,4 @@ Environment:
* [helm verify](helm_verify.md) - verify that a chart at the given path has been signed and is valid * [helm verify](helm_verify.md) - verify that a chart at the given path has been signed and is valid
* [helm version](helm_version.md) - print the client/server version information * [helm version](helm_version.md) - print the client/server version information
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -29,10 +29,11 @@ helm completion SHELL
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -48,10 +48,11 @@ helm create NAME
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -39,10 +39,11 @@ helm delete [flags] RELEASE_NAME [...]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -62,6 +62,7 @@ for this case.
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
@ -71,4 +72,4 @@ for this case.
* [helm dependency list](helm_dependency_list.md) - list the dependencies for the given chart * [helm dependency list](helm_dependency_list.md) - list the dependencies for the given chart
* [helm dependency update](helm_dependency_update.md) - update charts/ based on the contents of requirements.yaml * [helm dependency update](helm_dependency_update.md) - update charts/ based on the contents of requirements.yaml
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -35,10 +35,11 @@ helm dependency build [flags] CHART
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm dependency](helm_dependency.md) - manage a chart's dependencies * [helm dependency](helm_dependency.md) - manage a chart's dependencies
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -27,10 +27,11 @@ helm dependency list [flags] CHART
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm dependency](helm_dependency.md) - manage a chart's dependencies * [helm dependency](helm_dependency.md) - manage a chart's dependencies
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -40,10 +40,11 @@ helm dependency update [flags] CHART
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm dependency](helm_dependency.md) - manage a chart's dependencies * [helm dependency](helm_dependency.md) - manage a chart's dependencies
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -49,10 +49,11 @@ helm fetch [flags] [chart URL | repo/chartname] [...]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -41,6 +41,7 @@ helm get [flags] RELEASE_NAME
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
@ -50,4 +51,4 @@ helm get [flags] RELEASE_NAME
* [helm get manifest](helm_get_manifest.md) - download the manifest for a named release * [helm get manifest](helm_get_manifest.md) - download the manifest for a named release
* [helm get values](helm_get_values.md) - download the values file for a named release * [helm get values](helm_get_values.md) - download the values file for a named release
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -34,10 +34,11 @@ helm get hooks [flags] RELEASE_NAME
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm get](helm_get.md) - download a named release * [helm get](helm_get.md) - download a named release
###### Auto generated by spf13/cobra on 15-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -36,10 +36,11 @@ helm get manifest [flags] RELEASE_NAME
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm get](helm_get.md) - download a named release * [helm get](helm_get.md) - download a named release
###### Auto generated by spf13/cobra on 15-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -33,10 +33,11 @@ helm get values [flags] RELEASE_NAME
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm get](helm_get.md) - download a named release * [helm get](helm_get.md) - download a named release
###### Auto generated by spf13/cobra on 15-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -44,10 +44,11 @@ helm history [flags] RELEASE_NAME
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -22,10 +22,11 @@ helm home
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -62,10 +62,11 @@ helm init
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -36,6 +36,7 @@ helm inspect [CHART]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
@ -44,4 +45,4 @@ helm inspect [CHART]
* [helm inspect chart](helm_inspect_chart.md) - shows inspect chart * [helm inspect chart](helm_inspect_chart.md) - shows inspect chart
* [helm inspect values](helm_inspect_values.md) - shows inspect values * [helm inspect values](helm_inspect_values.md) - shows inspect values
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -34,10 +34,11 @@ helm inspect chart [CHART]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm inspect](helm_inspect.md) - inspect a chart * [helm inspect](helm_inspect.md) - inspect a chart
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -34,10 +34,11 @@ helm inspect values [CHART]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm inspect](helm_inspect.md) - inspect a chart * [helm inspect](helm_inspect.md) - inspect a chart
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -103,10 +103,11 @@ helm install [CHART]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 23-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -32,10 +32,11 @@ helm lint [flags] PATH
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -66,10 +66,11 @@ helm list [flags] [FILTER]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -41,10 +41,11 @@ helm package [flags] [CHART_PATH] [...]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 24-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -17,6 +17,7 @@ Manage client-side Helm plugins.
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
@ -27,4 +28,4 @@ Manage client-side Helm plugins.
* [helm plugin remove](helm_plugin_remove.md) - remove one or more Helm plugins * [helm plugin remove](helm_plugin_remove.md) - remove one or more Helm plugins
* [helm plugin update](helm_plugin_update.md) - update one or more Helm plugins * [helm plugin update](helm_plugin_update.md) - update one or more Helm plugins
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -30,10 +30,11 @@ helm plugin install [options] <path|url>...
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins * [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins
###### Auto generated by spf13/cobra on 20-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -19,10 +19,11 @@ helm plugin list
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins * [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -19,10 +19,11 @@ helm plugin remove <plugin>...
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins * [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -19,10 +19,11 @@ helm plugin update <plugin>...
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins * [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -21,6 +21,7 @@ Example usage:
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
@ -32,4 +33,4 @@ Example usage:
* [helm repo remove](helm_repo_remove.md) - remove a chart repository * [helm repo remove](helm_repo_remove.md) - remove a chart repository
* [helm repo update](helm_repo_update.md) - update information of available charts locally from chart repositories * [helm repo update](helm_repo_update.md) - update information of available charts locally from chart repositories
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -28,10 +28,11 @@ helm repo add [flags] [NAME] [URL]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories * [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -35,10 +35,11 @@ helm repo index [flags] [DIR]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories * [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -19,10 +19,11 @@ helm repo list [flags]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories * [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -19,10 +19,11 @@ helm repo remove [flags] [NAME]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories * [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -25,10 +25,11 @@ helm repo update
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories * [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -35,10 +35,11 @@ helm reset
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -41,10 +41,11 @@ helm rollback [flags] [RELEASE] [REVISION]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -32,10 +32,11 @@ helm search [keyword]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -40,10 +40,11 @@ helm serve
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -39,10 +39,11 @@ helm status [flags] RELEASE_NAME
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -44,10 +44,11 @@ helm template [flags] CHART
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 15-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -36,10 +36,11 @@ helm test [RELEASE]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -71,10 +71,11 @@ helm upgrade [RELEASE] [CHART]
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -34,10 +34,11 @@ helm verify [flags] PATH
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -48,10 +48,11 @@ helm version
--host string address of Tiller. Overrides $HELM_HOST --host string address of Tiller. Overrides $HELM_HOST
--kube-context string name of the kubeconfig context to use --kube-context string name of the kubeconfig context to use
--kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG
--port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT
--tiller-namespace string namespace of Tiller (default "kube-system") --tiller-namespace string namespace of Tiller (default "kube-system")
``` ```
### SEE ALSO ### SEE ALSO
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 7-Nov-2017 ###### Auto generated by spf13/cobra on 30-Nov-2017

@ -39,6 +39,8 @@ var DefaultHelmHome = filepath.Join(homedir.HomeDir(), ".helm")
type EnvSettings struct { type EnvSettings struct {
// TillerHost is the host and port of Tiller. // TillerHost is the host and port of Tiller.
TillerHost string TillerHost string
// TunnelLocalPort is the local port for portforward tunnel.
TunnelLocalPort int
// TillerNamespace is the namespace in which Tiller runs. // TillerNamespace is the namespace in which Tiller runs.
TillerNamespace string TillerNamespace string
// Home is the local path to the Helm home directory. // Home is the local path to the Helm home directory.
@ -59,6 +61,7 @@ func (s *EnvSettings) AddFlags(fs *pflag.FlagSet) {
fs.StringVar(&s.KubeConfig, "kubeconfig", "", "path to kubeconfig file. Overrides $KUBECONFIG") fs.StringVar(&s.KubeConfig, "kubeconfig", "", "path to kubeconfig file. Overrides $KUBECONFIG")
fs.BoolVar(&s.Debug, "debug", false, "enable verbose output") fs.BoolVar(&s.Debug, "debug", false, "enable verbose output")
fs.StringVar(&s.TillerNamespace, "tiller-namespace", "kube-system", "namespace of Tiller") fs.StringVar(&s.TillerNamespace, "tiller-namespace", "kube-system", "namespace of Tiller")
fs.IntVar(&s.TunnelLocalPort, "port", 0, "local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT")
} }
// Init sets values from the environment. // Init sets values from the environment.
@ -83,6 +86,7 @@ var envMap = map[string]string{
"host": "HELM_HOST", "host": "HELM_HOST",
"kubeconfig": "KUBECONFIG", "kubeconfig": "KUBECONFIG",
"tiller-namespace": "TILLER_NAMESPACE", "tiller-namespace": "TILLER_NAMESPACE",
"port": "TUNNEL_LOCAL_PORT",
} }
func setFlagFromEnv(name, envar string, fs *pflag.FlagSet) { func setFlagFromEnv(name, envar string, fs *pflag.FlagSet) {

@ -37,6 +37,7 @@ func TestEnvSettings(t *testing.T) {
// expected values // expected values
home, host, ns, kcontext, plugins string home, host, ns, kcontext, plugins string
debug bool debug bool
port int
}{ }{
{ {
name: "defaults", name: "defaults",
@ -47,30 +48,33 @@ func TestEnvSettings(t *testing.T) {
}, },
{ {
name: "with flags set", name: "with flags set",
args: []string{"--home", "/foo", "--host=here", "--debug", "--tiller-namespace=myns"}, args: []string{"--home", "/foo", "--host=here", "--debug", "--tiller-namespace=myns", "--port=44443"},
home: "/foo", home: "/foo",
plugins: helmpath.Home("/foo").Plugins(), plugins: helmpath.Home("/foo").Plugins(),
host: "here", host: "here",
ns: "myns", ns: "myns",
debug: true, debug: true,
port: 44443,
}, },
{ {
name: "with envvars set", name: "with envvars set",
args: []string{}, args: []string{},
envars: map[string]string{"HELM_HOME": "/bar", "HELM_HOST": "there", "HELM_DEBUG": "1", "TILLER_NAMESPACE": "yourns"}, envars: map[string]string{"HELM_HOME": "/bar", "HELM_HOST": "there", "HELM_DEBUG": "1", "TILLER_NAMESPACE": "yourns", "TUNNEL_LOCAL_PORT": "44444"},
home: "/bar", home: "/bar",
plugins: helmpath.Home("/bar").Plugins(), plugins: helmpath.Home("/bar").Plugins(),
host: "there", host: "there",
ns: "yourns", ns: "yourns",
debug: true, debug: true,
port: 44444,
}, },
{ {
name: "with flags and envvars set", name: "with flags and envvars set",
args: []string{"--home", "/foo", "--host=here", "--debug", "--tiller-namespace=myns"}, args: []string{"--home", "/foo", "--host=here", "--debug", "--tiller-namespace=myns", "--port=44443"},
envars: map[string]string{"HELM_HOME": "/bar", "HELM_HOST": "there", "HELM_DEBUG": "1", "TILLER_NAMESPACE": "yourns", "HELM_PLUGIN": "glade"}, envars: map[string]string{"HELM_HOME": "/bar", "HELM_HOST": "there", "HELM_DEBUG": "1", "TILLER_NAMESPACE": "yourns", "HELM_PLUGIN": "glade", "TUNNEL_LOCAL_PORT": "44444"},
home: "/foo", home: "/foo",
plugins: "glade", plugins: "glade",
host: "here", host: "here",
port: 44443,
ns: "myns", ns: "myns",
debug: true, debug: true,
}, },
@ -102,6 +106,9 @@ func TestEnvSettings(t *testing.T) {
if settings.TillerHost != tt.host { if settings.TillerHost != tt.host {
t.Errorf("expected host %q, got %q", tt.host, settings.TillerHost) t.Errorf("expected host %q, got %q", tt.host, settings.TillerHost)
} }
if settings.TunnelLocalPort != tt.port {
t.Errorf("expected port %d, got %d", tt.port, settings.TunnelLocalPort)
}
if settings.Debug != tt.debug { if settings.Debug != tt.debug {
t.Errorf("expected debug %t, got %t", tt.debug, settings.Debug) t.Errorf("expected debug %t, got %t", tt.debug, settings.Debug)
} }

@ -34,14 +34,14 @@ var (
) )
// New creates a new and initialized tunnel. // New creates a new and initialized tunnel.
func New(namespace string, client kubernetes.Interface, config *rest.Config) (*kube.Tunnel, error) { func New(namespace string, client kubernetes.Interface, config *rest.Config, localPort int) (*kube.Tunnel, error) {
podName, err := getTillerPodName(client.CoreV1(), namespace) podName, err := getTillerPodName(client.CoreV1(), namespace)
if err != nil { if err != nil {
return nil, err return nil, err
} }
const tillerPort = 44134 const tillerPort = 44134
t := kube.NewTunnel(client.Core().RESTClient(), config, namespace, podName, tillerPort) t := kube.NewTunnel(client.Core().RESTClient(), config, namespace, podName, tillerPort)
return t, t.ForwardPort() return t, t.ForwardPort(localPort)
} }
func getTillerPodName(client corev1.PodsGetter, namespace string) (string, error) { func getTillerPodName(client corev1.PodsGetter, namespace string) (string, error) {

@ -62,7 +62,7 @@ func (t *Tunnel) Close() {
} }
// ForwardPort opens a tunnel to a kubernetes pod // ForwardPort opens a tunnel to a kubernetes pod
func (t *Tunnel) ForwardPort() error { func (t *Tunnel) ForwardPort(localPort int) error {
// Build a url to the portforward endpoint // Build a url to the portforward endpoint
// example: http://localhost:8080/api/v1/namespaces/helm/pods/tiller-deploy-9itlq/portforward // example: http://localhost:8080/api/v1/namespaces/helm/pods/tiller-deploy-9itlq/portforward
u := t.client.Post(). u := t.client.Post().
@ -77,11 +77,15 @@ func (t *Tunnel) ForwardPort() error {
} }
dialer := spdy.NewDialer(upgrader, &http.Client{Transport: transport}, "POST", u) dialer := spdy.NewDialer(upgrader, &http.Client{Transport: transport}, "POST", u)
if localPort == 0 {
local, err := getAvailablePort() local, err := getAvailablePort()
if err != nil { if err != nil {
return fmt.Errorf("could not find an available port: %s", err) return fmt.Errorf("could not find an available port: %s", err)
} }
t.Local = local t.Local = local
} else {
t.Local = localPort
}
ports := []string{fmt.Sprintf("%d:%d", t.Local, t.Remote)} ports := []string{fmt.Sprintf("%d:%d", t.Local, t.Remote)}

@ -19,6 +19,7 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strconv"
"strings" "strings"
helm_env "k8s.io/helm/pkg/helm/environment" helm_env "k8s.io/helm/pkg/helm/environment"
@ -190,6 +191,8 @@ func SetupPluginEnv(settings helm_env.EnvSettings,
"TILLER_HOST": settings.TillerHost, "TILLER_HOST": settings.TillerHost,
"TILLER_NAMESPACE": settings.TillerNamespace, "TILLER_NAMESPACE": settings.TillerNamespace,
"TUNNEL_LOCAL_PORT": strconv.Itoa(settings.TunnelLocalPort),
} { } {
os.Setenv(key, val) os.Setenv(key, val)
} }

Loading…
Cancel
Save