|
|
@ -13,13 +13,23 @@ import (
|
|
|
|
var tunnel *kube.Tunnel
|
|
|
|
var tunnel *kube.Tunnel
|
|
|
|
|
|
|
|
|
|
|
|
func newTillerPortForwarder(namespace string) (*kube.Tunnel, error) {
|
|
|
|
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)
|
|
|
|
podName, err := getTillerPodName(namespace)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// FIXME use a constain that is accessible on init
|
|
|
|
// FIXME use a constain that is accessible on init
|
|
|
|
const tillerPort = 44134
|
|
|
|
const tillerPort = 44134
|
|
|
|
return kube.New(nil).ForwardPort(namespace, podName, tillerPort)
|
|
|
|
return kc.ForwardPort(namespace, podName, tillerPort)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func getTillerPodName(namespace string) (string, error) {
|
|
|
|
func getTillerPodName(namespace string) (string, error) {
|
|
|
|