Commit 907936c2 authored by Adam Reese's avatar Adam Reese

fix(tunnel): handle blank namespace

parent 68e0032f
......@@ -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