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

fix(tunnel): handle blank namespace
pull/877/head
Adam Reese 9 years ago committed by GitHub
commit fd28256aea

@ -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) {

Loading…
Cancel
Save