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
23905f14
Commit
23905f14
authored
Aug 04, 2017
by
Jerry Zhou
Committed by
z00417096 zhoujaiwei
Aug 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(helm):use a variable for labels to get tiller pod
parent
e61ee5c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
portforwarder.go
pkg/helm/portforwarder/portforwarder.go
+5
-2
portforwarder_test.go
pkg/helm/portforwarder/portforwarder_test.go
+1
-1
No files found.
pkg/helm/portforwarder/portforwarder.go
View file @
23905f14
...
...
@@ -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
...
...
pkg/helm/portforwarder/portforwarder_test.go
View file @
23905f14
...
...
@@ -29,7 +29,7 @@ func mockTillerPod() v1.Pod {
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"orca"
,
Namespace
:
v1
.
NamespaceDefault
,
Labels
:
map
[
string
]
string
{
"app"
:
"helm"
,
"name"
:
"tiller"
}
,
Labels
:
tillerPodLabels
,
},
Status
:
v1
.
PodStatus
{
Phase
:
v1
.
PodRunning
,
...
...
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