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
fc40bc8d
Commit
fc40bc8d
authored
Mar 29, 2016
by
Adam Reese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(cli): use kubectl builder consistently
parent
61a9296b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
20 deletions
+15
-20
server.go
cmd/helm/server.go
+15
-20
No files found.
cmd/helm/server.go
View file @
fc40bc8d
...
...
@@ -123,11 +123,12 @@ func dmCmd() cli.Command {
}
func
installServer
(
c
*
cli
.
Context
)
error
{
dryRun
:=
c
.
Bool
(
"dry-run"
)
resImg
:=
c
.
String
(
"resourcifier-image"
)
ebImg
:=
c
.
String
(
"expandybird-image"
)
manImg
:=
c
.
String
(
"manager-image"
)
runner
:=
getKubectlRunner
(
dryRun
)
dryRun
:=
c
.
Bool
(
"dry-run"
)
runner
:=
buildKubectlRunner
(
dryRun
)
i
:=
client
.
NewInstaller
()
i
.
Manager
[
"Image"
]
=
manImg
...
...
@@ -144,7 +145,7 @@ func installServer(c *cli.Context) error {
func
uninstallServer
(
c
*
cli
.
Context
)
error
{
dryRun
:=
c
.
Bool
(
"dry-run"
)
runner
:=
get
KubectlRunner
(
dryRun
)
runner
:=
build
KubectlRunner
(
dryRun
)
out
,
err
:=
client
.
Uninstall
(
runner
)
if
err
!=
nil
{
...
...
@@ -156,12 +157,9 @@ func uninstallServer(c *cli.Context) error {
func
statusServer
(
c
*
cli
.
Context
)
error
{
dryRun
:=
c
.
Bool
(
"dry-run"
)
client
:=
kubectl
.
Client
if
dryRun
{
client
=
kubectl
.
PrintRunner
{}
}
runner
:=
buildKubectlRunner
(
dryRun
)
out
,
err
:=
client
.
GetByKind
(
"pods"
,
""
,
"dm"
)
out
,
err
:=
runner
.
GetByKind
(
"pods"
,
""
,
"dm"
)
if
err
!=
nil
{
return
err
}
...
...
@@ -169,23 +167,20 @@ func statusServer(c *cli.Context) error {
return
nil
}
func
getKubectlRunner
(
dryRun
bool
)
kubectl
.
Runner
{
if
dryRun
{
return
&
kubectl
.
PrintRunner
{}
}
return
&
kubectl
.
RealRunner
{}
}
func
targetServer
(
c
*
cli
.
Context
)
error
{
dryRun
:=
c
.
Bool
(
"dry-run"
)
client
:=
kubectl
.
Client
if
dryRun
{
client
=
kubectl
.
PrintRunner
{}
}
out
,
err
:=
client
.
ClusterInfo
()
runner
:=
buildKubectlRunner
(
dryRun
)
out
,
err
:=
runner
.
ClusterInfo
()
if
err
!=
nil
{
return
fmt
.
Errorf
(
"%s (%s)"
,
out
,
err
)
}
format
.
Msg
(
string
(
out
))
return
nil
}
func
buildKubectlRunner
(
dryRun
bool
)
kubectl
.
Runner
{
if
dryRun
{
return
&
kubectl
.
PrintRunner
{}
}
return
&
kubectl
.
RealRunner
{}
}
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