|
|
|
@ -29,6 +29,10 @@ import (
|
|
|
|
|
"k8s.io/helm/pkg/kube"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
tillerPodLabels labels.Set = labels.Set{"app": "helm", "name": "tiller"}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// New creates a new and initialized tunnel.
|
|
|
|
|
func New(namespace string, client kubernetes.Interface, config *rest.Config) (*kube.Tunnel, error) {
|
|
|
|
|
podName, err := getTillerPodName(client.CoreV1(), namespace)
|
|
|
|
@ -41,8 +45,7 @@ func New(namespace string, client kubernetes.Interface, config *rest.Config) (*k
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func getTillerPodName(client corev1.PodsGetter, namespace string) (string, error) {
|
|
|
|
|
// TODO use a const for labels
|
|
|
|
|
selector := labels.Set{"app": "helm", "name": "tiller"}.AsSelector()
|
|
|
|
|
selector := tillerPodLabels.AsSelector()
|
|
|
|
|
pod, err := getFirstRunningPod(client, namespace, selector)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return "", err
|
|
|
|
|