Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
704bc472
Commit
704bc472
authored
Jan 20, 2017
by
Matthew Fisher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move newTillerPortForwarder to pkg/helm/portforwarder
parent
e440a36d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
12 deletions
+14
-12
helm.go
cmd/helm/helm.go
+9
-1
portforwarder.go
pkg/helm/portforwarder/portforwarder.go
+4
-10
portforwarder_test.go
pkg/helm/portforwarder/portforwarder_test.go
+1
-1
No files found.
cmd/helm/helm.go
View file @
704bc472
...
...
@@ -33,6 +33,7 @@ import (
"k8s.io/kubernetes/pkg/client/restclient"
"k8s.io/helm/cmd/helm/helmpath"
"k8s.io/helm/pkg/helm/portforwarder"
"k8s.io/helm/pkg/kube"
"k8s.io/helm/pkg/tiller/environment"
)
...
...
@@ -49,6 +50,8 @@ var (
tillerHost
string
tillerNamespace
string
kubeContext
string
// TODO refactor out this global var
tillerTunnel
*
kube
.
Tunnel
)
// flagDebug is a signal that the user wants additional output.
...
...
@@ -154,7 +157,12 @@ func markDeprecated(cmd *cobra.Command, notice string) *cobra.Command {
func
setupConnection
(
c
*
cobra
.
Command
,
args
[]
string
)
error
{
if
tillerHost
==
""
{
tunnel
,
err
:=
newTillerPortForwarder
(
tillerNamespace
,
kubeContext
)
config
,
client
,
err
:=
getKubeClient
(
kubeContext
)
if
err
!=
nil
{
return
err
}
tunnel
,
err
:=
portforwarder
.
New
(
tillerNamespace
,
client
,
config
)
if
err
!=
nil
{
return
err
}
...
...
cmd/helm/tunnel
.go
→
pkg/helm/portforwarder/portforwarder
.go
View file @
704bc472
...
...
@@ -14,27 +14,21 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package
main
package
portforwarder
import
(
"fmt"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/core/internalversion"
"k8s.io/kubernetes/pkg/client/restclient"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/helm/pkg/kube"
)
// TODO refactor out this global var
var
tillerTunnel
*
kube
.
Tunnel
func
newTillerPortForwarder
(
namespace
,
context
string
)
(
*
kube
.
Tunnel
,
error
)
{
config
,
client
,
err
:=
getKubeClient
(
context
)
if
err
!=
nil
{
return
nil
,
err
}
func
New
(
namespace
string
,
client
*
internalclientset
.
Clientset
,
config
*
restclient
.
Config
)
(
*
kube
.
Tunnel
,
error
)
{
podName
,
err
:=
getTillerPodName
(
client
.
Core
(),
namespace
)
if
err
!=
nil
{
return
nil
,
err
...
...
cmd/helm/tunnel
_test.go
→
pkg/helm/portforwarder/portforwarder
_test.go
View file @
704bc472
...
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package
main
package
portforwarder
import
(
"testing"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment