Commit fd28256a authored by Adam Reese's avatar Adam Reese Committed by GitHub

Merge pull request #869 from adamreese/fix/tunnel-blank-namespace

fix(tunnel): handle blank namespace
parents 2378a250 907936c2
......@@ -13,13 +13,23 @@ import (
var tunnel *kube.Tunnel
func newTillerPortForwarder(namespace string) (*kube.Tunnel, error) {
kc := kube.New(nil)
if namespace == "" {
ns, _, err := kc.DefaultNamespace()
if err != nil {
return nil, err
}
namespace = ns
}
podName, err := getTillerPodName(namespace)
if err != nil {
return nil, err
}
// FIXME use a constain that is accessible on init
const tillerPort = 44134
return kube.New(nil).ForwardPort(namespace, podName, tillerPort)
return kc.ForwardPort(namespace, podName, tillerPort)
}
func getTillerPodName(namespace string) (string, error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment