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
14efdee0
Commit
14efdee0
authored
Mar 24, 2016
by
Matt Butcher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(cli): switched `server` actions to use `run()`
parent
084c0da5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
32 deletions
+17
-32
server.go
cmd/helm/server.go
+17
-32
No files found.
cmd/helm/server.go
View file @
14efdee0
...
...
@@ -19,7 +19,6 @@ package main
import
(
"errors"
"fmt"
"os"
"github.com/codegangsta/cli"
"github.com/kubernetes/helm/pkg/client"
...
...
@@ -68,16 +67,7 @@ func dmCmd() cli.Command {
EnvVar
:
"HELM_MANAGER_IMAGE"
,
},
},
Action
:
func
(
c
*
cli
.
Context
)
{
dry
:=
c
.
Bool
(
"dry-run"
)
ri
:=
c
.
String
(
"resourcifier-image"
)
ei
:=
c
.
String
(
"expandybird-image"
)
mi
:=
c
.
String
(
"manager-image"
)
if
err
:=
install
(
dry
,
ei
,
mi
,
ri
);
err
!=
nil
{
format
.
Err
(
"%s (Run 'helm doctor' for more information)"
,
err
)
os
.
Exit
(
1
)
}
},
Action
:
func
(
c
*
cli
.
Context
)
{
run
(
c
,
installServer
)
},
},
{
Name
:
"uninstall"
,
...
...
@@ -90,12 +80,7 @@ func dmCmd() cli.Command {
Usage
:
"Show what would be uninstalled, but don't remove anything."
,
},
},
Action
:
func
(
c
*
cli
.
Context
)
{
if
err
:=
uninstall
(
c
.
Bool
(
"dry-run"
));
err
!=
nil
{
format
.
Err
(
"%s (Run 'helm doctor' for more information)"
,
err
)
os
.
Exit
(
1
)
}
},
Action
:
func
(
c
*
cli
.
Context
)
{
run
(
c
,
uninstallServer
)
},
},
{
Name
:
"status"
,
...
...
@@ -107,22 +92,13 @@ func dmCmd() cli.Command {
Usage
:
"Only display the underlying kubectl commands."
,
},
},
Action
:
func
(
c
*
cli
.
Context
)
{
if
err
:=
status
(
c
.
Bool
(
"dry-run"
));
err
!=
nil
{
os
.
Exit
(
1
)
}
},
Action
:
func
(
c
*
cli
.
Context
)
{
run
(
c
,
statusServer
)
},
},
{
Name
:
"target"
,
Usage
:
"Displays information about the Kubernetes cluster."
,
ArgsUsage
:
""
,
Action
:
func
(
c
*
cli
.
Context
)
{
if
err
:=
target
(
c
.
Bool
(
"dry-run"
));
err
!=
nil
{
format
.
Err
(
"%s (Is the cluster running?)"
,
err
)
os
.
Exit
(
1
)
}
},
Action
:
func
(
c
*
cli
.
Context
)
{
run
(
c
,
targetServer
)
},
Flags
:
[]
cli
.
Flag
{
cli
.
BoolFlag
{
Name
:
"dry-run"
,
...
...
@@ -134,7 +110,11 @@ func dmCmd() cli.Command {
}
}
func
install
(
dryRun
bool
,
ebImg
,
manImg
,
resImg
string
)
error
{
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
)
i
:=
client
.
NewInstaller
()
...
...
@@ -146,11 +126,14 @@ func install(dryRun bool, ebImg, manImg, resImg string) error {
if
err
!=
nil
{
return
err
}
if
debug
{
format
.
Msg
(
out
)
}
return
nil
}
func
uninstall
(
dryRun
bool
)
error
{
func
uninstallServer
(
c
*
cli
.
Context
)
error
{
dryRun
:=
c
.
Bool
(
"dry-run"
)
runner
:=
getKubectlRunner
(
dryRun
)
out
,
err
:=
client
.
Uninstall
(
runner
)
...
...
@@ -161,7 +144,8 @@ func uninstall(dryRun bool) error {
return
nil
}
func
status
(
dryRun
bool
)
error
{
func
statusServer
(
c
*
cli
.
Context
)
error
{
dryRun
:=
c
.
Bool
(
"dry-run"
)
client
:=
kubectl
.
Client
if
dryRun
{
client
=
kubectl
.
PrintRunner
{}
...
...
@@ -182,7 +166,8 @@ func getKubectlRunner(dryRun bool) kubectl.Runner {
return
&
kubectl
.
RealRunner
{}
}
func
target
(
dryRun
bool
)
error
{
func
targetServer
(
c
*
cli
.
Context
)
error
{
dryRun
:=
c
.
Bool
(
"dry-run"
)
client
:=
kubectl
.
Client
if
dryRun
{
client
=
kubectl
.
PrintRunner
{}
...
...
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